feat(shutdown): drain WebSocket clients on SIGTERM - #773
Conversation
🦋 Changeset detectedLatest commit: d3993fa The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Review — drain WebSocket clients on SIGTERMThe shape is right and the mechanics are sound: the worker owns both the HTTP routes and the WS server, so the draining flag genuinely reaches 1. The 30 s drain ceiling cannot be honored in the reference deploymentThe root Practical impact today is small — the CLOSED frames and the close handshake go out immediately, and the timeout is only a ceiling — but the knob should mean something. Either set/document a Related, in the same method: the primary's 2. The
|
Drain WebSockets before closing the HTTP listener so /readyz can return 503 with status draining and honest dependency health. Add stop_grace_period to reference compose files, bound primary shutdown wait, use worker.kill(), and add app shutdown unit tests.
|
Addressed the comments. |
Description
/readyzreturns 503 so load balancers stop routing new trafficCLOSEDand graceful WS closeWS_DRAIN_TIMEOUT_MS(default 30s); primary forwards SIGTERM to cluster workers and waits for exitRelated Issue
Fixes :- #772
Motivation and Context
How Has This Been Tested?
Screenshots (if appropriate):
Types of changes
Checklist: