Skip to content

12.26.2

Choose a tag to compare

@timgit timgit released this 21 Jul 20:58
· 622 commits to master since this release

What's Changed

Fixes

Recover silent LISTEN/NOTIFY connection drops. The dedicated listener connection could go half-open — TCP dies with no FIN and no error event — leaving notify-enabled workers silently degraded to the 30s polling backstop with no recovery. The listener now runs two independent detectors:

  • TCP keepalive on the listen connection for OS-level dead-peer detection.
  • Same-session heartbeat that verifies the channel subscription is still live, catching both a hung socket and a lost subscription while the socket looks fine.

On any drop it tears down, reconnects with capped backoff, re-runs LISTEN, and fires the reconnect hook so workers drain jobs missed during the gap. Works identically over SSL/TLS connections.

New options

Heartbeat and keepalive timings are now tunable via the constructor (previously hardcoded) — useful for raising the heartbeat timeout on a loaded database:

  • notifyHeartbeatIntervalMs — interval between listener heartbeat checks. Default 10000.
  • notifyHeartbeatTimeoutMs — per-heartbeat query timeout; the listener reconnects if a heartbeat exceeds it. Default 5000.
  • notifyKeepAliveInitialDelayMs — TCP keepalive initial delay on the listener connection. Default 10000.

Defaults preserve prior behavior, so no action is needed unless you want to tune them.

New Contributors

  • @unix made their first contribution in #851

Full Changelog: 12.26.1...12.26.2