Skip to content

refactor(cluster): bring the calvin dispatch/scheduler and error files back under the 500-line limit #353

Closed

Description

@EnRaiha

Summary

Three files this branch touches exceed, or grow past, the house 500-line
non-test limit, so the local preflight (check C5) fails and was bypassed for the
fix push:

File base head
nodedb/src/control/cluster/calvin/scheduler/driver/core/dispatch.rs 504 542
nodedb/src/control/cluster/calvin/scheduler/driver/core/scheduler.rs 436 506
nodedb/src/error/types.rs 589 601

Work

  • extract the busy helpers (busy_backoff, note_dispatch_busy,
    note_dispatch_busy_shared) from scheduler.rs into a small core/busy.rs;
  • extract a self-contained piece of dispatch.rs (for example the active
    dispatch path) into its own module and thin the two dispatch sites;
  • move any impl Error helper block out of error/types.rs into a sibling
    module (the Error enum itself cannot be split);
  • target: every changed file at or under 500 non-test lines, preflight C5 green.

Activity

  1. EnRaiha commented on Sep 20, 2026

    @EnRaiha
    ContributorAuthor

    Resolved on fix/calvin-backpressure (PR #355), pushed preflight-clean without a bypass:

    File base before now
    core/dispatch.rs 504 543 387
    core/scheduler.rs 436 508 459
    nodedb/src/error/types.rs 589 601 586
    • busy helpers (busy_backoff, note_dispatch_busy, note_dispatch_busy_shared) moved to core/busy.rs; the active dispatch path moved to core/active_dispatch.rs; the static dispatch site now calls note_dispatch_busy instead of duplicating the backoff block.
    • error/types.rs has no impl Error block to move — the file is the enum plus the Result alias — and the enum cannot be split without changing the public API, so it cannot reach 500 non-test lines. It is back below its base count, which is the C5 rule for a pre-existing over-limit file: no growth.
    • Evidence: preflight pass · Calvin determinism gate clean · cargo check -p nodedb and clippy clean · 217 calvin lib tests + busy_backoff_is_bounded_and_jittered pass.
  2. self-assigned this
    on Sep 23, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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