Skip to content

Drain gateway replica connections on unregister - #4495

Merged
un-def merged 2 commits into
masterfrom
issue_4493_gateway_replica_drain
Nov 18, 2026
Merged

un-def merged 2 commits into
masterfrom
issue_4493_gateway_replica_drain

Conversation

@un-def

@un-def un-def commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Unregistering a replica closed its SSH tunnel before reloading Nginx, so requests already in flight through the tunnel were cut, and POST requests routed to the replica before the reload got 502.

Reload Nginx first, then close the tunnel in the background: after a 5s grace period for Nginx workers that haven't picked up the reload, once nothing is connected to its socket (per /proc/net/unix), and after 5 minutes at most.

Part-of: #4493

un-def and others added 2 commits November 17, 2026 14:51
Unregistering a replica closed its SSH tunnel before reloading Nginx,
so requests already in flight through the tunnel were cut, and POST
requests routed to the replica before the reload got 502.

Reload Nginx first, then close the tunnel in the background: after a
5s grace period for Nginx workers that haven't picked up the reload,
once nothing is connected to its socket (per /proc/net/unix), and
after 5 minutes at most.

Part-of: #4493
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@un-def
un-def merged commit 1f64ff3 into master Nov 18, 2026
26 checks passed
@un-def
un-def deleted the issue_4493_gateway_replica_drain branch November 18, 2026 08:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant