Repository navigation
Conversation
…me safety Fixes: mutex acquisition from the pthread TLS destructor (retireThreadByTid lock-free path), TidIndex use-after-free for in-flight lock-free readers in ~ThreadFilter, capacityExhausted() hint/gate contract, and context-window state update races.
…cker state fixes Timer loops re-read recordingEpoch() each tick instead of caching it; stop() keeps the pthread_t when pthread_join fails; flushUnownedBlockedTail resets only on valid payloads; owned-run admission preserves unflushed unowned-blocked weight; test-only exitBlockedRun overload gated behind UNIT_TEST; epoch publish ordering tightened. Adds lazyBackfill timer-path coverage and positive-path fuzz assertions for owned-block suppression.
…k engine teardown
…aProfilerTestSupport to test sources The registry-activity accessor now returns false in release builds; the hooks live on JavaProfiler (DEBUG-gated natives) instead of a public support class shipped in the main jar.
…haos threads stopProfiler() no longer wipes trace context unconditionally; the force-wall-start-failure toggle is disarmed in @AfterEach; wall-precheck counter reads use getOrDefault to avoid NPEs; the parked-worker spin loop yields; the churn antagonist checks join results and reuses one interruptor thread.
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 3f77b7836b
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
There was a problem hiding this comment.
More details
The completed static review identified no reportable defects in deferred thread retirement, wall-clock restart handling, or blocked-time accounting. Runtime behavior was not tested.
🤖 Bits Code Review · Commit 3f77b78
CI Test ResultsRun: #43021271121 | Commit:
No CI outcome reports were found for this run. Updated: 2026-11-11 12:34:40 UTC |
Preserve reusable exact-ID roots and retained context across rotations and recording/context restarts. Keep ordinary sample weight one while accounting for timer work and wake lateness with monotonic deadlines. Add fixed-size phase diagnostics and bounded shutdown/drain regressions without weakening the one-second collapsing oracle.
What does this PR do?:
Hardens the wall-clock precheck and thread registry from #663, and completes reusable unowned wall-clock root preservation, retained context, recording/context restarts, and monotonic timer cadence. This is the stacked follow-up to #663: its base remains
paul.fournillon/wallclock-all-threads; #663 itself is unchanged.awaitBatch/joinUntil/stopGracefullyimplementation: every worker must drain before success; interruption, stalls, expired/submillisecond budgets and scheduler cleanup cannot silently report success. The 14-case suite exercises real independently gated workers and both disabled commands.Motivation:
Cached wall stacks must remain live and keep their factual identity/context across context changes, dumps and fresh recordings. Timer work/wake lateness should not reduce a nominal one-second sampling opportunity window, and shutdown must not leave hook-emitting workers behind. Signal handlers retain their no-allocation/no-locking constraints; no tracer/backend changes or production rollout are included.
Additional Notes:
e8c3dfbd6d719bc654fa46b55e9912c248191781(blob56a38829f0e95b6e2ee1e360ff6597e89595f16d, GJF 1.30.0 and lazy Java-plugin registration). fix(wall): address sphinx review findings for #663 #890's stacked feat(wall): support signal suppression for unfiltered threads #663 base still has GJF 1.7, so this upstream prerequisite is carried here to make the branch's own JVM25 formatting gates work; main already contains it. The former local GJF 1.36.1 prerequisite and unpublished formatter-only TestKit are not included. This is the canonical upstream fix, not a competing formatter implementation.VirtualThreadWallClockTest,cstack=vmx, still fails to observeForkJoinWorkerThreadcarrier frames on macOS ARM64 / HotSpot25. Debug: 48 passed / 22 skipped / 1 failed; production Release: 46 passed / 24 skipped / 1 failed (71 reached per configuration). This pre-existing diagnostic repeats the preserved predecessor outcomes; it was not filtered out or fixed here. Follow-up is routed to the JVM/stack-walker domain (feat: emit TaskBlock events for JVM blocking states #665 / CORE), and the broad host wall package is not reported passing.totalWeight > 700andcount > 9predicates. No weighting compensation, fabricated stack/thread identity, scheduled timestamp or weakened oracle was used.5ac5c5bbfbfe2b1520317d946b0d656a4dc22692; source-set SHA256:189782eacee8320d802d6f5c3d6159d666f81cea01f6eaf2a2506ef4138cc81b. Evidence/design/scratch files are not part of the change.How to test the change?:
All Gradle execution uses
./.claude/commands/build-and-summarize.Fresh final-candidate macOS ARM64 / HotSpot25 results:
spotlessApply+spotlessCheckpassed with the upstream formatter; no source bytes changed; not an aggregate full-repository style claimReproduction tasks:
:ddprof-lib:gtestDebug,:ddprof-lib:gtestRelease;:ddprof-stresstest:testOwnedBlockPrecheck --tests com.datadoghq.profiler.chaos.ParkBlockChurnAntagonistTest;:ddprof-test:testDebug -Ptests=com.datadoghq.profiler.lifecycle.StartWithChurningThreadsTest; and the unchangedWallClockPrecheckOverheadBenchmarkJMH include. Retain recordings with-PkeepJFRsfor tests andJAVA_TOOL_OPTIONS=-Dddprof_test.keep_jfrs=truefor JMH. The broadcom.datadoghq.profiler.wallclock.*Debug/Release commands reproduce the open diagnostic. Source/JDK/compiler/wrapper/XML/JFR/native-image identities and owned-process cleanup are bound in the qualification manifest; two independent reviews approved the final reconciled tree.For Datadog employees: