Repository navigation
Abort pending optimizing compiles before collecting kept boxes in tracing-test - #8621
Merged
Merged
Conversation
"wrappables are charged as external memory while they live" builds its boxes in a 10,000-iteration loop, which V8 may optimize on a background thread. A compile job still pending when the test collects them keeps every box alive, and the test sees nothing released (1120000 bytes remaining). The job usually finishes first, so this failed only now and then, on release, RBE and ASan builds. With --concurrent-recompilation-delay=300, which keeps the job pending, the test failed 10 runs out of 10. A heap snapshot taken after the failed check found every box collectable: its GC aborts concurrent optimization first. Call v8::Isolate::ClearCachesForTesting() before the GCs. It aborts the pending Turbofan and Maglev jobs and waits for them. With the delay flag, the test then passed 10 runs out of 10. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
danlapid
marked this pull request as ready for review
November 22, 2026 01:47
There was a problem hiding this comment.
✅ Approved — Small test-only change that fixes a flake. The description's evidence supports the cause and the fix, and I found no problems.
The decision is advisory: this review is a comment and never approves, blocks or requests changes on the pull request.
✅ All checks passed
📋 Code reviewer: ✅ LGTM
No issues found.
Reviewed commit: bbeba9a8
danlapid
enabled auto-merge
November 22, 2026 02:00
littledivy
approved these changes
Nov 22, 2026
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.
tracing-test.c++"wrappables are charged as external memory while they live" (added in #8496) fails now and then on edgeworker CI. It failed 5 times on 2026-11-18, in both the@and@all-autogatesvariants, on release, RBE and ASan builds. The final check fails with nothing released:expected remaining < int64_t(sizeof(NumberBox)) * 16 [1120000 < 1792].Cause:
keepBoxes()builds its 10,000 boxes in a hot loop, which V8 may optimize on a background thread. If that compile job is still pending when the test dropskeepand forces its two GCs, the job keeps every box alive.Evidence:
--concurrent-recompilation-delay=300, which keeps the job pending, the test failed 10 runs out of 10.kGCCallbackFlagForced), and neither released anything.CollectAllAvailableGarbage()aborts concurrent optimization first.keepglobal did not help: with the delay, it still failed 10 runs out of 10.Fix: call
v8::Isolate::ClearCachesForTesting()before the GCs. It aborts the pending Turbofan and Maglev jobs and waits for them. With the delay flag, the test then passed 10 runs out of 10.Testing: run from edgeworker with
--config=bazelflare:--runs_per_test=20ontracing-test@andtracing-test@all-autogates: all pass.--config=asan, both variants: pass.🤖 Generated with Claude Code