Skip to content

c10k hardening — remaining Medium/Low findings (D3, D4, E1, E3, E4, F1–F6) #438

Description

@TinDang97

Tracking issue for the unaddressed findings from the c10k hardening review
(tmp/C10K-HARDENING-REVIEW.md, 30 findings, 2026-07-30). Every 🔴 Critical and
🟠 High finding has now merged; what remains here is all 🟡 Medium / ⚪ Low.

Landed (for context)

Remaining

Cluster D — park-design robustness

  • 🟡 D4 (routing F7) — Migration races the pipelined batch tail. Gate checked mid-batch, migration executes at batch end with no re-check; MigratedConnectionState carries no command_queue/in_multi/subs/tracking. […GETs, MULTI, SET] → migrates with in_multi=true, queued txn discarded, tail SUBSCRIBE orphaned. Fix: re-evaluate the gate at the migration point.

Cluster F — lifecycle / shutdown / invariant hygiene

  • 🟡 F1 (conn#8) — Graceful shutdown doesn't drain: shard returns from run, drops the runtime, every pending conn task dropped; clients see truncated replies, not clean FIN. Fix: bounded drain phase + shutdown arm on the stage-1/2 read parks.
  • F2 (conn#9 / sec L1)kill_clients fd-liveness invariant no longer literally holds for parked conns (drop order = capture order). Not exploitable today; one refactor (F1's drain) from a shutdown(2)-on-reused-fd. Fix: wrap {guard,stream} with a hand-written guard-first Drop.
  • F3 (routing F10) — Central-accept loop head-of-line blocks on one wedged shard's full 4096-conn channel. Central-accept only (non-Linux/TLS/tests). Fix: try_send + round-robin next shard.
  • F4 (routing F12) — Migration fd lifecycle: raw i32 payload with no Drop leaks the fd on shutdown/undelivered; resumed-parked conns permanently can_migrate:false.
  • F5 (sec L3) — Migrated ConnectionContext carries requirepass:None (inert today, loaded gun for future auth re-derivation).
  • F6 (sec L2) — Unauthenticated conns are parkable with no auth deadline (park a maxclients-worth of silent conns at 3.3 KB each).
  • conn-secondarykept_registration miss-arm counter-leak (fail-open); is_sweep_cancel matches bare errno 125 (non-sweep ECANCELED misread).

Test hygiene (found while validating #441)

Notes

  • No Critical/High remains; these are defense-in-depth + correctness-under-saturation.
  • Suggested next wave: D4 → F1/F2 (F1 and F2 interact — the drain refactor is what makes F2 exploitable, so land them together) → F3–F6 + conn-secondary.
  • Full detail + line refs in tmp/C10K-HARDENING-REVIEW.md.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions