Skip to content

Refactor oversized shard connection modules after #446 #447

Description

@coderabbitai

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.

Metadata

Metadata

Assignees

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