Skip to content

Fix reference-chain nightly flakes (PROF-16305) and drop their quarantine - #899

Draft
jbachorik wants to merge 4 commits into
mainfrom
fix-nightlies
Draft

jbachorik wants to merge 4 commits into
mainfrom
fix-nightlies

Conversation

@jbachorik

@jbachorik jbachorik commented Oct 25, 2026 •

Copy link
Copy Markdown
Collaborator

What does this PR do?:
Fixes the intermittently-red reference-chain slow e2e family (PROF-16305) with one product fix plus test-side hardening, and removes the PROF-16305 quarantine added in #888. The branch carries four commits:

  1. 2277cb539 — PROF-16316: keep resolved leak chains across improve-path invalidations (EVICT/REBUILD invalidation kinds, in-band sign-bit encoding, generation-guarded BFS rebuild from the intact frontier; replace-only, no behavior change elsewhere).
  2. 4b0879ed4 — fix reference-chain revisits and leak-candidate admission.
  3. 2908999d6 — make the reference-chain slow e2e tests robust to walk-pacing latency (schedule reshape, front-loaded reference pressure, richer failure diagnostics).
  4. 37fc26255 — remove all four PROF-16305 quarantine lines from ddprof-test/quarantine.txt.

Motivation:
The nightly sanitized run 39893765385 had the reference-chain slow family failing in ~20 of ~32 eligible HotSpot 11+ debug/asan jobs, which is what #888 quarantined. Root causes are now fixed rather than quarantined:

  • Late thread-local variant (PROF-16316): improveChain's deferred invalidation erased cached leak chains at dump time, and the terminal pass zeroed candidate/discovered state so nothing could rebuild them — defeating the restartSearch() keep-across-restart contract. Fixed by 2277cb539.
  • Cache-leak variant: the walk-starvation mode (tags assigned, but the BFS never intercepts a leak-tagged payload in the 131,072-slot table) is addressed by the 4b0879ed4 revisit/admission regime plus the 2908999d6 test-side pacing fixes.
  • gc-root variant on musl-aarch64 JDK 11: validated clean on the full stack (see below), so its quarantine line is dropped.

Additional Notes:
Dependencies — this PR is stacked and should not merge before its dependencies:

How to test the change?:

  • Native: gtest for the PROF-16316 fix fails before 2277cb539 and passes after (full :ddprof-lib:gtestDebug 189/189).
  • e2e: full reference-chain slow family validated on the complete stack — Temurin 21: 20/20 (+ prebuild pass) incl. a dedicated 10/10 musl-aarch64 JDK 11 container run; jdk11 9/10 with the only residual being Fix reference-chain discovery and leak test prerequisites #889's known cache-leak residual (tracked there); late-TL variant 0 failures post-fix.
  • Negative control: sabotaging the drain path makes the fixed tests fail loudly with the new diagnostics suffix.
  • Quarantine validator: ddprof-test/quarantine.txt validate script passes; regular (non-slow) suite 61/61 unaffected.

For Datadog employees:

  • If this PR touches code that signs or publishes builds or packages, or handles
    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.
  • This PR doesn't touch any of that.
  • JIRA: PROF-16305 (and PROF-16316)

jbachorik and others added 4 commits October 24, 2026 20:15
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.
The reference-chain walks are paced by the CPU pain budget; on slow cells the
second pass can land late in the tests' dump windows, leaving only the first
pass's uncorrelated chains (TL/LeakTag loose variants report out-of-pool or
not-found in CI nightlies, PROF-16305).

Test-side schedule changes within the existing bounds (no assertion weakened,
no retries/skips, static entry caps kept):
- cache-leak: growth completes by round 10, rounds 11-16 poll with a small
  top-up so the BFS drains its frontier backlog and intercepts a leak-tagged
  payload with slack (<= 36,601 entries, down from 69,001)
- failure-only referenceChainDiagnostics() helper appended to the
  assertNotNull messages of the cache-leak and gc-root tests (debug-
  instrumented builds only; release returns empty string)
- ThreadLocalLeakScenario: keeps full per-round chunk growth (the late-variant
  correlation needs the whole interception surface; verified on JDK 11) but
  keeps the filler at a quarter size so pass 0's pain-budget debt is repaid
  well inside the window
- LeakTagCorrelationScenario: front-loaded growth with sparse top-ups, tail
  rounds quiet; keep-best ladder unchanged
All four reference-chain slow e2e tests leave quarantine: the pr-889
regime plus the W5 test-side pacing fixes and the PROF-16316
improveChain invalidation fix (PR #898) cleared the failures. The
gc-root musl-aarch64 line is dropped after a 10/10 clean
musl-aarch64 JDK11 container validation of the full stack.
@jbachorik jbachorik added the AI label Oct 25, 2026
@dd-octo-sts

dd-octo-sts Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

CI Test Results

Run: #40192745607 | Commit: fae8f05 | Duration: 18m 59s (longest job)

✅ All 32 test jobs passed

Status Overview

JDK glibc-aarch64/debug glibc-amd64/debug musl-aarch64/debug musl-amd64/debug
8 - ✅ - -
8-ibm - ✅ - -
8-j9 ✅ ✅ - -
8-librca - - ✅ ✅
8-orcl - ✅ - -
11 - ✅ - -
11-j9 ✅ ✅ - -
11-librca - - ✅ ✅
17 ✅ ✅ - -
17-graal ✅ ✅ - -
17-j9 ✅ ✅ - -
17-librca - - ✅ ✅
21 ✅ ✅ - -
21-graal ✅ ✅ - -
21-librca - - ✅ ✅
25 ✅ ✅ - -
25-graal ✅ ✅ - -
25-librca - - ✅ ✅

Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled

Summary: Total: 32 | Passed: 32 | Failed: 0


Updated: 2026-10-25 12:44:29 UTC

@dd-octo-sts

dd-octo-sts Bot commented Oct 25, 2026

Copy link
Copy Markdown
Contributor

✅ All 40 integration tests passed

📊 Dashboard · 👷 Pipeline · 📦 37fc2625

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants