dyninst: detach before unregistering sink #50726
All Vouch review confidence checks passed
Residual risk 0.16 = Change Risk (0.37) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 213 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.17 · 1 substantive comment(s)
Model 3 · Review Timing & Attention
Session adequacy: 100% · Reviewer familiarity: 35%
Bedrock Claude 3 · Risk Narration
(disconnected)
Groq Risk Narration
AWS Bedrock is currently disconnected. Generate high-confidence PR triage narration on-demand using Groq.
Model 1 · Change Risk Attribution
SHAP Weights
Diff Size
diff_size
0.321
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #50726"
general
weight: 0.35
grantseltzer
What does this PR do?
loadedProgramImpl.Closepreviously calleddispatcher.UnregisterSinkbeforeonProgramDetached.UnregisterSinksynchronously drains the sink:sink.Closeforce-finalizes any buffered invocations and callsemiton each, which callssetProbeMaybeEmitting→diagnostics.reportEmitting. That lookup is keyed onprocRuntimeIDbyProgramID, whichonProgramDetachedclears — but only after the drain has run, so the drain still reports "emitting" diagnostics for a runtimeID whose process has already been removed (and whose diagnostics tracker entries were just cleared byprocessStore.remove). The re-inserted entry has no future event that would ever clear it, soDiagnosticsStatesnever drains.Fix: clear the programID→runtimeID mapping before draining the sink so the final-drain emits become no-ops at the lookup. Same fix applies to
reportProbeError, which has the same lookup pattern.Motivation
This surfaced as flakes in
TestDropNotifications/S4_partial_return_under_pressure: theEventuallyWithT(... DiagnosticsStates ... Empty)assertion would time out with a strandedcapture_bytes_return: [emitted]entry. S4 is the scenario most likely to hit this — a small entry that decodes cleanly sits buffered waiting on a PARTIAL_RETURN notification that may not arrive before shutdown, then force-finalizes and decodes successfully during sink.Close. S3 (entry-side drops) leaves no decodable entry; S5 (RETURN_LOST with huge entries) often has nothing decodable either; both hit emit()'s "nothing to decode" early return and skip the re-emit.Describe how you validated your changes
It deflakes the test
Additional Notes