Skip to content

Comments

Connection Draining Infrastructure#115

Merged
Mac-5 merged 2 commits intoSynapse-bridgez:developfrom
miss-yusrah:feat/connection-draining
Feb 23, 2026
Merged

Connection Draining Infrastructure#115
Mac-5 merged 2 commits intoSynapse-bridgez:developfrom
miss-yusrah:feat/connection-draining

Conversation

@miss-yusrah
Copy link
Contributor

closes #100

Summary
Implements connection draining to enable zero-downtime rolling deployments by allowing in-flight requests to complete before shutdown.

Changes

  • Added /ready endpoint (separate from /health) for Kubernetes readiness probes
  • Returns 200 when accepting traffic, 503 during drain
  • On SIGTERM: immediately stops accepting new connections, waits up to 30s for in-flight requests

New Files

  • src/readiness.rs - AtomicBool-based readiness state
  • tests/readiness_unit_test.rs - Unit tests
  • tests/connection_draining_test.rs - Integration tests

Modified Files

  • src/config.rs - Added DRAIN_TIMEOUT_SECS config
  • src/handlers/mod.rs - Added /ready handler
  • src/lib.rs - Wired readiness into AppState
  • src/main.rs - Added SIGTERM handler with graceful shutdown

Configuration

  • DRAIN_TIMEOUT_SECS - Drain timeout in seconds (default: 30)

@Mac-5 Mac-5 changed the base branch from main to develop February 23, 2026 04:57
@Mac-5 Mac-5 merged commit 6215385 into Synapse-bridgez:develop Feb 23, 2026
0 of 6 checks passed
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.

Connection Draining for Zero-Downtime Deployments (Infrastructure)

2 participants