Skip to content

feat(shutdown): drain WebSocket clients on SIGTERM - #773

Open
Ferryx349 wants to merge 1 commit into
mainfrom
feat/ws-drain
Open

feat(shutdown): drain WebSocket clients on SIGTERM#773
Ferryx349 wants to merge 1 commit into
mainfrom
feat/ws-drain

Conversation

@Ferryx349

Copy link
Copy Markdown
Collaborator

Description

  • On SIGTERM, /readyz returns 503 so load balancers stop routing new traffic
  • Rejects new WebSocket connections and drains existing clients with Nostr CLOSED and graceful WS close
  • Bounded by WS_DRAIN_TIMEOUT_MS (default 30s); primary forwards SIGTERM to cluster workers and waits for exit

Related Issue

Fixes :- #772

Motivation and Context

How Has This Been Tested?

Screenshots (if appropriate):

Types of changes

  • Non-functional change (docs, style, minor refactor)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist:

  • My code follows the code style of this project.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have read the CONTRIBUTING document.
  • I have added tests to cover my code changes.
  • I added a changeset, or this is docs-only and I added an empty changeset.
  • All new and existing tests passed.

@changeset-bot

changeset-bot Bot commented Sep 12, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: d1ea235

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
nostream Minor

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

@coveralls

Copy link
Copy Markdown
Collaborator

Coverage Status

coverage: 72.207% (-0.08%) from 72.283% — feat/ws-drain into main

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.

2 participants