fix(cloud): let stats reads cancel through the shared read coordinator - #14228
Merged
Merged
Conversation
#13327 added single-flight stats reads inside VMResourceStatsStore. It was written before #13151 landed CloudReadRequestCoordinator, which already shares every concurrent /stats GET per account, team, and auth generation and cancels the HTTP read once its last caller leaves. The store-level task duplicated that sharing but ran unstructured, so a removed machine or a hidden panel kept its stats request alive until the 30 s timeout. The coordinator's waiter accounting also stopped seeing callers, and three VMClientReadCoalescingTests cases timed out on every main run. Stats reads now fence per caller with beginRead/finishRead, which keeps the revision and sequence ordering from #13327's store, and share the network request through the coordinator. The store's read(machineID:) and its tests go away with it; VMClientReadCoalescingTests covers sharing, cancellation, and resize invalidation at the client. This reverts commit c72f659df746cfcabf1e5ab1b92b99ec8b09b38c. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Warning Review limit reachedNext included review available in 1 minute. View limit detailsLimit details: You’ve used all 10 included reviews currently available. You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Review configuration: ⚙️ Run configurationConfiguration used: Repository: manaflow-ai/cmux/.coderabbit.yaml Review profile: ASSERTIVE Plan: Advanced Run ID: 📒 Files selected for processing (4)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Contributor
|
All contributors have signed the CLA ✍️ ✅ |
teamleaderleo
enabled auto-merge (squash)
September 24, 2026 13:51
rustybret
pushed a commit
to rustybret/bmux
that referenced
this pull request
Sep 24, 2026
7434ad0 fix(cloud): let stats reads cancel through the shared read coordinator (manaflow-ai#14228) 7c0cd0b test(ssh): fix SSHStartupManualReconnectTests after the cmux-tui SSH migration (manaflow-ai#14209) b3b50e8 ci: let persistent-compile up onboard a mini that has no gh (manaflow-ai#14227) ea10f16 ci: let a second nightly mini take requests (manaflow-ai#14223) d5d578a ci: rerun app-host tests against the merge a pull_request run built (manaflow-ai#14221) # Conflicts: # .github/workflows/app-host-test-rerun.yml # .github/workflows/nightly-mini-build.yml
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.
Why
Three
VMClientReadCoalescingTestscases fail on every main full-suite run since #13327 landed (06:35Z on 09-24):The failures point at a real behavior regression, not just stale tests.
#13151 (merged ~03:00Z) added
CloudReadRequestCoordinator. It already shares every concurrent/statsGET per account, team, and auth generation, and it cancels the HTTP read once its last caller leaves. #13327 was written before that landed. It added a second single-flight layer insideVMResourceStatsStorethat runs the fetch in an unstructuredTask. That layer has two effects:/api/vm/removed/statsstays in flight after the fleet drops the machine.What changed
This reverts #13327:
VMClient.statsfences each caller withbeginRead/finishRead. That keeps the revision and sequence ordering the store owns, so resize, reset, and removal still reject late completions.VMResourceStatsStore.read(machineID:), itsreadTaskfield, and the tests that only covered that method are removed.VMClientReadCoalescingTestscovers the same ground at the client, with cancellation included: shared reads, hidden-panel cancellation, and resize invalidation.Verification
Focused run of
VMClientReadCoalescingTestsandVMResourceStatsStoreTestsonblacksmith-6vcpu-macos-15: 36 tests in 2 suites pass. run🤖 Generated with Claude Code
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.Summary by cubic
Fixes a stats read regression so machine stats requests cancel when their last caller leaves.
beginRead/finishReadto preserve revision and sequence ordering for resize, reset, and removal.VMResourceStatsStore.read(machineID:), itsreadTaskfield, and the tests that only covered the store-level method;VMClientReadCoalescingTestscovers sharing, cancellation, and resize invalidation at the client.Written for commit 839a0c4. Summary will update on new commits.