fix(profiling): leave out partial asyncio task stacks read during a task switch #22272
All Vouch review confidence checks passed
Residual risk 0.21 = Change Risk (0.36) × (1 − Review Confidence (0.43)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.36 · 197 lines diff across 2 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.02 · 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
Shallow Review Depth
shallow_review_depth
0.344
Diff Size
diff_size
0.316
Real PR Conversation Timeline
1 comments
"Review active on #22272"
general
weight: 0.35
gyuheon0h
Description
Fixes the flaky
test_deep_suspended_task_keeps_innermost_frames.The sampler reads a task's coroutine chain, then its frames. If the task resumes or finishes in between, some frames are already cleared.
TaskInfo::unwindstopped at the first unreadable frame but kept the frames read before it, which got stitched onto the event loop frames.TaskInfo::unwindnow leaves out all of a task's coroutine frames when one can't be read. The sample keeps its wall time.Customer impact
A task sample taken while the task resumes or finishes no longer shows a truncated coroutine stack under the event loop frames.
Testing
CPython 3.14, env
b0d11c843434, 4 parallel loops of 400 runs,DD_TEST_CPUS=0.5, host under load:Risks
If a frame stays unreadable, that task's samples lose all coroutine frames. No benchmark covers stack unwinding and only the failure path changed.
Additional Notes
test_suspended_task_does_not_inherit_running_sibling_frameshas a different cause, addressed by #22037.