Keep the scheduler hook session alive until its disposers run - #446
Merged
Conversation
The two ScheduleDriver tests that count server-side disposals of the hook capabilities flaked with an opaque 5s timeout. workerd runs an RpcTarget's disposer as a task of the RPC session that created it and aborts a non-actor session as "hung" once its last pending event is gone; the returned capabilities were that session's only pending events, so releasing them armed the abort, which raced the disposer task and occasionally cancelled it. The test initiator now holds the session open with a pending timer until both disposers have run, and the tests await an in-Worker `waitForDisposals` that reports the counts reached and the hook timeline instead of polling with a budget equal to the test timeout. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
Posted 1 actionable inline finding. |
Preview:
|
`waitForDisposals` now requires the counts to equal the target once reached, so an extra disposer invocation fails instead of passing, and each hook capability records the reset generation it was minted under so a disposer from an earlier test that lands after `reset()` is not counted. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
|
LGTM! |
Maximo-Guk
marked this pull request as ready for review
September 4, 2026 15:49
ndisidore
approved these changes
Sep 4, 2026
modataconsulting
added a commit
to MO-Data-Consulting/cloudflare-os
that referenced
this pull request
Sep 4, 2026
* Let a test command raise its watchdog idle threshold (cloudflare#442) * Let a test command raise its watchdog idle threshold * Keep the scheduler hook session alive until its disposers run (cloudflare#446) * Keep the scheduler hook session alive until its disposers run * Fix eval config startup (cloudflare#447) --------- Co-authored-by: Maximo Guk <62088388+Maximo-Guk@users.noreply.github.com> Co-authored-by: Ashish Kumar Singh <ashishsingh@cloudflare.com>
modataconsulting
added a commit
to MO-Data-Consulting/cloudflare-os
that referenced
this pull request
Sep 8, 2026
* Let a test command raise its watchdog idle threshold (cloudflare#442) * Let a test command raise its watchdog idle threshold * Keep the scheduler hook session alive until its disposers run (cloudflare#446) * Keep the scheduler hook session alive until its disposers run * Fix eval config startup (cloudflare#447) * chore: bump Workers compatibility date (cloudflare#448) * Render selected skills as composer pills (cloudflare#422) * feat(DESENG-0000): render selected skills as composer pills * fix(DESENG-0000): simplify composer skill pills * fix(frontend): preserve composer spell checking * Add composer skill picker (cloudflare#423) * feat(frontend): add composer skill picker * fix(frontend): restore composer skill picker behavior * fix(DESENG-0000): avoid clipped picker focus outline * fix(frontend): harden composer skill picker * fix(frontend): refine composer options menu * test(frontend): send unconfirmed slash text plainly * fix(frontend): refresh composer skill catalogs * fix(frontend): preserve plain slash submission * fix(frontend): activate composer option on Tab * fix(frontend): refine composer picker layout * feat(frontend): show skill context in slash picker * fix(frontend): preserve composer overlay focus * fix(frontend): avoid stale composer picker state * Fix Outputs sidebar not stretching to full height (cloudflare#454) --------- Co-authored-by: Maximo Guk <62088388+Maximo-Guk@users.noreply.github.com> Co-authored-by: Ashish Kumar Singh <ashishsingh@cloudflare.com> Co-authored-by: Nathan Disidore <nathan@cloudflare.com> Co-authored-by: Bálint Ferenczy <40574454+FBalint@users.noreply.github.com> Co-authored-by: Phillip Jones <pjones@cloudflare.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes the
schedule-driver.test.tsdisposal-count flake (e.g. https://github.com/cloudflare/cloudflare-os/actions/runs/33825527399/job/100877250818).workerd aborts the
startHookRPC session as "hung" the moment the driver releases the returned capabilities, racing the task that runs theirSymbol.dispose, when the abort wins, the disposer never runs. The test initiator now holds the session open until both disposers have run, and the tests await one in-WorkerwaitForDisposalsthat reports the counts reached on failure. Test fixture only.Reproduced 1 in 60 runs under CPU load before; 0 in 100 after.