fix(runs): contain state Worker background tasks - #2160
Merged
Merged
Conversation
coreplane-switchboard
Bot
requested a review
from justinhelmer
as a code owner
September 21, 2026 20:01
Contributor
Author
There was a problem hiding this comment.
LGTM: The pending-work seam correctly keeps plane pushes within the Durable Object lifetime and makes cross-test leakage fail at its source.
Note
Approved · head 514cdf3 · no findings
Full review
No findings. The pending-task guard and waitUntil integration address the cross-test leak without changing plane delivery semantics.
Co-Authored-By: coreplane-switchboard[bot] <318072483+coreplane-switchboard[bot]@users.noreply.github.com>
coreplane-switchboard
Bot
force-pushed
the
plan/fix-issue-2119-the-memor-7b7c49/u1
branch
from
September 21, 2026 20:09
514cdf3 to
f2da680
Compare
Contributor
Author
There was a problem hiding this comment.
LGTM: The round-two lint fix is correct, and both prior failed-check findings are resolved.
Note
Approved · head f2da680 · no findings
Full review
The round-two fix resolves the lint failure without changing promise settlement behavior. No findings remain.
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.
Keeps best-effort state Worker pushes inside the Durable Object request lifetime and fails the originating test when registered work remains pending. This prevents detached I/O from delaying an unrelated memory Worker test.
Why: #2119 kept failing a different fast Durable Object case after #2146 closed the alarm leak; #2156 exposed the remainder. A detached effect push could outlive its case and contend in the shared workerd isolate.
Where to look
Feedback wanted: Check that waitUntil is the right ownership boundary for best-effort effect pushes and that the global label map cannot hide a production rejection.
Risk: Blast radius is state Worker plane-effect delivery and its test pool. A bad guard may fail tests that legitimately retain work; revert f2da680 to restore the prior behavior.
Verified: 62 focused tests, scoped ESLint, Worker tsc, formatting, hygiene, specs and coverage passed. Full verify and ten-run Depot stress remain CI-gated.
Decisions (3)
Validation (9 criteria)
npm test --workspace deploy/cloudflare-memory -- backgroundTasks.test.ts runLedger.test.ts→ 62/62 passed.npx eslinton the six changed TypeScript files → exit 0.NODE_OPTIONS=--max-old-space-size=6144 npx tsc --noEmit -p deploy/cloudflare-memory/tsconfig.json→ exit 0.npx prettier --checkon all seven changed files → all matched.npm run hygiene:check→ exit 0; 9 files and 37 listed hits remain.npm run specs:check→ exit 0; 51 specs and 5,634 references checked.npm run specs:coverage -- --changed origin/main...HEAD --test-guard→ all paths covered; test guard passed.npm run check:pr-title -- "fix(runs): contain state Worker background tasks"→ exit 0.npx vitestattempts exited 1 after selecting zero files; the workspace-scoped command above used Vitest 4.1.11 and passed.For agents
Rebased onto origin/main at 1073acc immediately before validation and force-pushed as one commit at f2da680. The two
alarm unavailablelines are expected output from explicit rejection fixtures and remained handled. Full memory Worker verify and ten consecutive CI-pool runs remain CI-gated. No generated files changed.Requested by @justinhelmer in slack:C0BRRHKFLCB
🤖 Generated with Claude Code