Skip to content

Live scheduler: deliver a ready burst when the events end behind a busy consumer - #66

Open
MelbourneDeveloper wants to merge 1 commit into
mainfrom
fix/scheduler-final-trigger
Open

MelbourneDeveloper wants to merge 1 commit into
mainfrom
fix/scheduler-final-trigger

Conversation

@MelbourneDeveloper

Copy link
Copy Markdown
Collaborator

TLDR

The live scheduler again delivers a burst whose quiet window has elapsed when the events end while the consumer is still busy. The v0.11.0 release review against v0.10.1 found this regression and blocked the release on it.

Details

  • Bug. Since the bounded backlog change ([MEM-LIFETIME-SCHEDULER-BACKLOG]), a burst whose quiet window has elapsed waits for the consumer's single free slot. If the event source then ends, Step::Ended returned without sending that burst.
    • Example: the consumer is still holding trigger A, burst B becomes ready, then the event sender is dropped. The consumer receives A and then None.
    • In v0.10.1: the consumer received A and then B.
  • Fix. deliver_ready in crates/lspkit-server/src/live/scheduler.rs sends a ready burst once a slot frees, then the task ends. If there is no ready burst, it returns at once. If the consumer has already gone, nothing is sent.

How Do The Automated Tests Prove It Works?

  • live_scheduler.rs::events_ending_behind_a_busy_consumer_still_deliver_the_ready_burst:

    1. holds trigger A unread;
    2. lets burst B become ready;
    3. drops the event sender;
    4. asserts the consumer gets A, then B with its exact path, then None.

    It failed before the fix (the ready burst survives the end of the events) and passes after it.

  • All 13 live_scheduler tests and all 566 workspace tests pass.

  • Locally, the coverage gate passes for lspkit-server and lspkit-server::live. lspkit (98.56%) and lspkit::sidecar (97.18%) miss their thresholds by the same amount on unchanged main on this macOS machine. main passes them on CI.

Spec / doc changes

None. The doc comments on run and deliver_ready cite [MEM-LIFETIME-SCHEDULER-BACKLOG].

Breaking changes

None.

🤖 Generated with Claude Code

This branch has not been deployed

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant