Repository navigation
test: fix load-dependent flake in nativeThreadNameRace_ut (wait for /proc task unhash before scans) - #979
Merged
Conversation
Contributor
CI Test ResultsRun: #43440990394 | Commit:
Status Overview
Legend: ✅ passed | ❌ failed | ⚪ skipped | 🚫 cancelled Summary: Total: 32 | Passed: 31 | Failed: 0 | Cancelled: 1 Updated: 2026-11-13 17:19:14 UTC |
Contributor
This comment has been minimized.
This comment has been minimized.
Contributor
Scan-Build Report
Bug Summary
Filter Results by FileReports
|
|||||||||||||||||||||||||||||||||||||||||||||||||
jbachorik
marked this pull request as ready for review
November 12, 2026 09:20
Codex Review Summary: ✅ CompletedThis 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. |
jbachorik
added a commit
that referenced
this pull request
Nov 12, 2026
…antine entry on main gates it while #979 fixes the root cause
2 tasks done
jbachorik
added a commit
that referenced
this pull request
Nov 12, 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.
What does this PR do?:
Fixes a load-dependent flake in
nativeThreadNameRace_ut.threadDyingBetweenScansIsNeverNamedondd-gitlab/gtest-asan-amd64. Afterpthread_join, the test now polls until the exited thread's tid disappears from/proc/self/taskbefore running the native-thread-name scan passes.Motivation:
The test assumed
pthread_joinreturning implies the tid is gone from/proc/self/task. The kernel does not guarantee that:pthread_joinreturns when the exiting thread clearsclear_child_tidinexit_mm()(mm_release(),kernel/fork.c), but the tid stays listed untilexit_notify()→release_task()→__unhash_process()unhashes it — a real window in which the tid is still listed with a readable inherited comm. On a throttled shared CI runner the dying thread can sit descheduled in that window while the joiner runs the test's passes; the dump-time pass (defer=false) then records the mid-exit tid under its inherited process comm, and the test sees"nativeThreadNam"instead of"".Verification (exact CI build image,
registry.ddbuild.io/ci/async-profiler-build@81eab385, linux/amd64):pthread_joinreturned, with the comm readable and equal to the process name on hits.The pinned invariant is unchanged and now matches what the kernel guarantees: a thread invisible to the scans is never named. Naming a listed (mid-exit) thread is desirable production behavior — it is the refresher-pass gap filler for short-lived threads — so no product code changes.
Additional Notes:
EXPECTdiagnoses the residual visibility.main(d723d998d); not part of the open Add HotSpot layout-offset value cross-checks and ASan granule rounding #968 stack.<stdio.h>include); the tid-reuse-during-poll finding was refuted by adjudication (tids allocate monotonically untilpid_maxwraparound, not eagerly recycled); the 30 s worst-case stall is accepted by design.How to test the change?:
and on CI:
dd-gitlab/gtest-asan-amd64.For Datadog employees:
credentials of any kind, I've requested a security review (run the
dd:platform-security-reviewskill, or file a request via the PSEC review form).
bewairealso runs automatically on every PR.