Repository navigation
Conversation
improveChain/reparent/root-kind upgrades queued a deferred invalidation that drainPendingChainEvents applied as an erase at dump time. If the search then terminated via the canary, nothing could rebuild the erased chains (candidate and discovered state are zeroed, search pain-budget blocked ~11-15s), losing the correlation for the rest of the window - against the restartSearch() contract that resolved chains stay cached across a restart. Split deferred invalidations into EVICT (noise eviction, filter: erased at dump time as before) and REBUILD (path changed, source still live: applied by the BFS-thread poll, which rebuilds the chain from the intact frontier and keeps the old chain if the rebuild fails). Kind is encoded in-band in the existing bounded pending buffers; no new allocation or locks. Reproducer: ReferenceChainsBfsTest.ImprovedPathInvalidationKeepsLeakChainAcrossTerminalReset (fails before, passes after). PROF-16316.
1 task done
❌ ErrorsYour PR has failed checks. Please review the issues below and take necessary action before merging. 🚦 1 Pipeline job failed
Useful? React with 👍 / 👎 This comment will be updated automatically if new data arrives.🔗 Commit SHA: 2277cb5 | Docs | View more details | Give us feedback! |
Contributor
CI Test ResultsRun: #40173283212 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 32 | Failed: 0 Updated: 2026-10-25 07:57:13 UTC |
2 of 3 tasks
This branch has not been deployed
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.
What does this PR do?:
Splits reference-chain deferred cache invalidations into two kinds. EVICT (noise eviction, event filter) keeps today's behavior: the cached chain is erased at dump time. REBUILD (
improveChaindeeper path, durable-root demotion, root-kind upgrade — the source object is still live and its frontier entry intact) is no longer erased at dump time; the BFS-thread poll rebuilds the chain from the intact frontier instead, overwriting the cache entry on success and keeping the old chain if the rebuild fails.Motivation:
PROF-16316.
improveChain()'s deferred invalidation erased resolved leak-correlated chains that the documentedrestartSearch()contract says must stay cached across a restart ("a chain resolved by the finishing search stays cached (and keeps being re-emitted on every dump) across the restart, since it describes a sample that is still live"). When the improve fires in the terminal pass of a search (new backing array of a growing holder, deeper path), the drain erases the chains, the terminal branch then zeroes candidate/discovered state so nothing can rebuild them, and the search stays pain-budget-blocked ~11-15 s — every later dump re-emits 0 chains and the correlation is lost for the rest of the window.Deterministic reproducer in the e2e suite:
ThreadLocalLeakReferenceChainTest.shouldCorrelateLeakOnThreadCreatedAfterRecordingStarton JDK 11 fails exactly when the pass-1 CPU pain-budget debt is already repaid when the canary closes (15 instrumented runs: debt ≥1021 ms → 4/4 pass, ≤988 ms → 11/11 fail). Pre-existing: the involved paths are untouched by #889.Additional Notes:
How to test the change?:
For Datadog employees:
credentials of any kind, I've requested a security review (run the `dd:platform-security-review`
skill, or file a request via the PSEC review form).
`bewaire` also runs automatically on every PR.