Skip to content

A throwing backoff function leaves a connection short of Closed #23

Closed

Description

@okomarov

A backoff option given as a function is called by lost() and afterFailure() through backoffMs() before the connection enters Closed (src/connection.js). If it throws, the phase change never finishes: the connection never reaches Closed, and a query queued for it hangs.

Reproduced during the #13 review on main and on fix/callback-guard: a throwing backoff, a reserved lease whose backend is terminated, and a query queued on the pool, which never settles.

#13 routes callbacks that only observe through src/callback.js. backoff returns the delay, so it can't simply be rethrown in a microtask: it needs a fallback delay (for example the default backoff) when it throws, plus the rethrow so the bug is visible.

Activity

  1. moved this to Shipped in Roadmapon Oct 15, 2026
  2. added
    area: connections
    bug
    on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area: connectionsbug

    Type

    No type

    Projects

    • Status
      Shipped

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions