Summary
Refactor the oversized Rust modules that remain after the Cluster F hardening work.
This follow-up is intentionally separate from PR #446. The current PR changes connection lifecycle behavior. A mechanical module split in the same change would make that behavior harder to review.
Required changes
- Extract the pending migration queue drain and connection handoff from
src/shard/event_loop.rs into a focused module.
- Split connection lifecycle responsibilities from dispatch responsibilities in
src/server/conn/handler_sharded/mod.rs.
- Preserve the current connection migration, shutdown, registration, and dispatch behavior.
Rationale
The repository coding guideline requires that no Rust source file exceeds 1500 lines. These files already exceeded that limit before PR #446. The hardening PR adds only limited changes, so this refactor is deferred to keep the behavioral diff focused.
Affected areas
src/shard/event_loop.rs
src/server/conn/handler_sharded/mod.rs
Backlinks
Acceptance criteria
- The migration-drain and handoff logic is in a focused module.
- Connection lifecycle and dispatch responsibilities are separated into focused modules.
- Each resulting Rust source file complies with the 1500-line guideline.
- Existing public and internal behavior remains unchanged.
- The relevant unit and consistency tests pass.
- Formatting and Clippy complete without new warnings for both runtime feature configurations.
Summary
Refactor the oversized Rust modules that remain after the Cluster F hardening work.
This follow-up is intentionally separate from PR #446. The current PR changes connection lifecycle behavior. A mechanical module split in the same change would make that behavior harder to review.
Required changes
src/shard/event_loop.rsinto a focused module.src/server/conn/handler_sharded/mod.rs.Rationale
The repository coding guideline requires that no Rust source file exceeds 1500 lines. These files already exceeded that limit before PR #446. The hardening PR adds only limited changes, so this refactor is deferred to keep the behavioral diff focused.
Affected areas
src/shard/event_loop.rssrc/server/conn/handler_sharded/mod.rsBacklinks
Acceptance criteria