Problem
On shutdown, the relay hard-kills all WebSocket clients via webSocket.terminate(). During a rolling deploy, subscribers on the dying instance disconnect abruptly.
HAProxy can retry failed HTTP on another backend, but not in-flight WebSockets. /readyz (#763) handles readiness; WS drain is the missing piece before the HAProxy blue/green overlay.
Proposal
On SIGTERM:
- Return 503 on /readyz and stop accepting new connections
- Gracefully close existing WebSocket clients (not terminate())
- Wait up to WS_DRAIN_TIMEOUT_MS (default 30s), then force-close stragglers
- Coordinate shutdown across cluster workers
Ref: https://statusdude.com/blog/zero-downtime-docker-compose
Problem
On shutdown, the relay hard-kills all WebSocket clients via webSocket.terminate(). During a rolling deploy, subscribers on the dying instance disconnect abruptly.
HAProxy can retry failed HTTP on another backend, but not in-flight WebSockets. /readyz (#763) handles readiness; WS drain is the missing piece before the HAProxy blue/green overlay.
Proposal
On SIGTERM:
Ref: https://statusdude.com/blog/zero-downtime-docker-compose