You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
A backoff that returns undefined reconnects in a hot loop #31
A backoff function that returns undefined (or an explicit backoff: undefined option) gives a delay of NaN ms, which setTimeout treats as 1 ms. Against unreachable hosts that is a hot reconnect loop: the #23 review measured 349 connect attempts in one second against two refused hosts.
Fix: treat a non-finite or negative result as the default backoff, and an explicit undefined option as unset.
Related, found while documenting backoff in #141: types/index.d.ts declares backoff: boolean | ((attemptNum: number) => number), but the runtime also takes a number of seconds (backoff is parsed as an integer from PGBACKOFF and ?backoff=), and true is used as 1 second. The fix here could settle the accepted values in the types too: a number or a function, with false for no delay.
Activity
okomarov commentedon Oct 18, 2026
Related, found while documenting
backoffin #141:types/index.d.tsdeclaresbackoff: boolean | ((attemptNum: number) => number), but the runtime also takes a number of seconds (backoffis parsed as an integer fromPGBACKOFFand?backoff=), andtrueis used as 1 second. The fix here could settle the accepted values in the types too: a number or a function, withfalsefor no delay.