Skip to content

Sockudo v5.2.0

Latest

Choose a tag to compare

@github-actions github-actions released this 22 Oct 09:37
· 284 commits to master since this release
9b4f047

Sockudo 5.2.0 adds Apache Iggy cluster support and fixes several reliability problems reported in production: leaked connections after pong timeouts, Redis subscribers that silently stop receiving, lost presence webhooks on shutdown, and cross-node broadcasts dropped by newly started nodes. Idle connections also use about 43% less memory, and three TLS certificate-trust advisories are fixed.

Protocol V1 Pusher compatibility is unchanged.

⚠️ Upgrade notes

  • iggy deployments: the Iggy SDK moves from 0.10 to 0.11, which requires Apache Iggy server 0.9 or newer. Iggy 0.8.x and 0.9 do not share a wire protocol, and Iggy 0.9 starts from a fresh data directory. Upgrade the Iggy servers before you roll out this release. The bundled compose files now pin apache/iggy:0.9.0.
  • Shutdown takes longer: after the listener grace period, graceful shutdown now waits for presence cleanup and webhook delivery, bounded by queue.reliability.shutdown_timeout_ms (30 s by default). Raise your supervisor timeout (for example, Kubernetes terminationGracePeriodSeconds) to cover listener grace, this drain, and queue worker shutdown.
  • Rate limiting behind proxies: with trust_hops = 0, both X-Forwarded-For and X-Real-IP are now ignored. If you relied on X-Real-IP at zero, set trust_hops explicitly (1 behind NGINX, 2 behind a Google external Application Load Balancer) and block direct access to Sockudo. Otherwise every proxied client shares the proxy's rate-limit bucket.
  • Publishing while draining: on a node without a horizontal adapter, /events and /batch_events now return 503 with code draining and a Retry-After header during shutdown, instead of 200 for events that no subscriber would receive. Publishers should retry against a healthy instance.

✨ Highlights

Apache Iggy VSR clusters

The iggy adapter and queue now follow the cluster leader, fail over to surviving replicas, route polls and offset commits to the partition primary, and rejoin consumer groups after membership loss. New settings:

  • cluster_seeds (IGGY_CLUSTER_SEEDS): extra replicas to try at startup.
  • connect_timeout_ms (IGGY_CONNECT_TIMEOUT_MS, default 2 s): limits each dial attempt.
  • failover_timeout_ms (IGGY_FAILOVER_TIMEOUT_MS, default 15 s): lets publishes wait out a leader election.
  • durability / consumer_offset_durability: replicated (the default) or persisted.

docker-compose.iggy-cluster.yml runs three Iggy replicas with three Sockudo nodes.

Graceful shutdown that loses nothing

  • On SIGTERM, Sockudo closes existing connections with 4200 right away, so clients reconnect even if the pod is killed during the drain window.
  • Presence leases, delayed member_removed webhooks, and the final webhook batch are drained before queue and cache connections close.
  • Memory-queue jobs finish before exit.

Horizontal scaling reliability

  • Redis adapter: sometimes Redis disappears without closing the connection and comes back at the same address, for example during a managed resize or a network partition. Previously each node then kept publishing but received nothing until it was restarted. The subscriber connection is now pinged every pubsub_ping_interval_ms (default 10 s) and resubscribes when a ping fails. Each resubscribe increments sockudo_horizontal_transport_reconnections_total.
  • New nodes: a newly started node no longer drops its cross-node broadcasts while it is still discovering peers. Peers answer its first heartbeat right away.

Connection and presence correctness

  • Pong-timeout leak: connections no longer leak after a Protocol V1 pong timeout (close code 4201). Previously, sockudo_connected drifted above the real socket count, memory grew, and presence channels kept members whose member_removed never fired. Disconnect cleanup now finishes even if its caller is cancelled. tests/load/pong-timeout-leak.mjs reproduces the old leak.
  • Presence identities: when a socket leaves a presence channel, member_removed now reports the identity it joined that channel with, not a socket-wide ID.

Memory and observability

  • Idle WebSocket connections use about 43% less resident memory: 68 KiB → 39 KiB per connection at 10,000 idle connections.
  • OpenTelemetry fixes:
    • The configured service_name is now exported instead of unknown_service:sockudo.
    • Health probes and /metrics scrapes no longer create root spans.
    • Horizontal adapter consumer spans are now exported in release builds, so a trace continues onto the nodes that deliver the message.
  • Client authentication failures on socket messages are logged at warn instead of error.

🐛 Other fixes

  • The memory cache driver now honors per-key TTLs. Previously every entry was kept for cache.memory.ttl (300 s by default), so for example /channels listings were served stale for minutes.
  • Rate-limit client IP extraction rejects short, malformed, or duplicated forwarded headers and falls back to the socket peer's address.

📦 Dependencies

  • Security: rustls-webpki 0.103.16 and webpki-roots / webpki-root-certs 1.0.10, so TLS clients no longer trust distrusted emSign intermediates (RUSTSEC-2026-0381, RUSTSEC-2026-0382, RUSTSEC-2026-0383).
  • sockudo-ws 3.1.0.
  • Updated: rustls 0.23.46 (fixes a cargo deny advisory), redis 1.7.1, tokio 1.54, hyper 1.12, rmcp 3.6, lapin 4.12, scylla 1.9, surrealdb 3.3.4, google-cloud-pubsub 1.7, the AWS SDK (aws-config 1.13), and others.
  • cargo audit now passes with no ignored advisories.
  • Docker images now build with Rust 1.99.

Installation

Linux installer (Recommended)

curl --proto '=https' --tlsv1.2 -sSfL \
  https://sockudo.io/install.sh \
  | sh -s -- --version 5.2.0

Using cargo

cargo install sockudo --version 5.2.0

Using Docker

docker pull ghcr.io/sockudo/sockudo:5.2.0
docker pull sockudo/sockudo:5.2.0

Using Helm

helm install sockudo \
  oci://ghcr.io/sockudo/charts/sockudo \
  --version 5.2.0

Direct Download

Linux archives and their SHA-256 checksums are attached below.

Platform Support

  • ✅ Linux x86_64 (GNU)
  • ✅ Linux x86_64 (musl)
  • ✅ Linux ARM64 (GNU)
  • ✅ Linux ARM64 (musl)
  • ✅ Docker linux/amd64
  • ✅ Docker linux/arm64
  • 🛠️ Other platforms via cargo install sockudo

What's Changed

  • fix(server): properly close existing connections with 4200 on SIGTERM by @lilfaf in #468
  • fix: connections leaking after an activity/pong timeout by @K-Leon in #470
  • fix(server): refuse publishes while draining instead of acknowledging them by @K-Leon in #472
  • fix(observability): OpenTelemetry service name, probe spans, and adapter consumer spans by @jedi-tal in #473
  • chore(docker): bump rust from 1.98-bookworm to 1.99-bookworm by @dependabot[bot] in #474
  • fix(adapter): finish disconnect cleanup when its caller is cancelled by @countradooku in #475
  • fix(cache): honor per-key TTLs in the memory cache driver by @countradooku in #476
  • fix(logs): downgrade recoverable auth errors in message loop to warn by @lilfaf in #477
  • feat(iggy): support Apache Iggy VSR clusters in the adapter and queue by @countradooku in #478
  • chore(deps): bump the cargo-minor-and-patch group with 17 updates by @dependabot[bot] in #480
  • fix(adapter): resubscribe when a redis subscriber connection goes silent by @npwvestjens in #481
  • perf(adapter): box large futures in the websocket connection handler by @npwvestjens in #482
  • fix: upgrade rustls to fix cargo deny check by @lilfaf in #484
  • Fix channel-specific presence identities on unsubscribe and disconnect by @countradooku in #485
  • fix: validate forwarded IP trust for rate limiting by @countradooku in #486
  • fix: drain presence cleanup and webhook delivery on shutdown by @countradooku in #487
  • fix(kotlin-sdk): avoid JDK APIs missing on Android and guard the API surface by @lilfaf in #488 (released separately as Kotlin client 2.3.1)
  • chore(release): prepare Sockudo 5.2.0 by @countradooku in #494

New Contributors

Full Changelog: v5.1.0...v5.2.0