Fail StreamController writes once the response is in #62
All Vouch review confidence checks passed
Residual risk 0.17 = Change Risk (0.39) × (1 − Review Confidence (0.57)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 262 lines diff across 3 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.333
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #62"
general
weight: 0.35
jasikpark
Summary
Fixes the
StreamControllerpanic Brad flagged during review of #61, which is now onmain, and the hang that dnclient's log streaming actually hits. Both are instreamingPostDNClient's response goroutine.atomic.Value, e.g. a body read error and then the status error. A second store with a different type panics and takes dnclient down.Writeblocked forever. That leaked the goroutine, left Nebula at the verbose log level, and kept oneStreamLogsMaxslot in use.A non-200 never ends up with a nil error. Write after a 200 also no longer hangs.
Evidence
TestStreamControllerResponse: success, an errors array, no errors array, a truncated body, a complete body followed by a read failure, a 401, a truncated 401 and a truncated 200. On the old code these panic or report the wrong result.TestStreamControllerEndUnblocksWrite: aWriteprovably in flight (one byte still unread) returns once the server rejects the request or the transport sees the context end. On the old code it hangs.-race -count=50passes.Not fixed
If the context is canceled on an idle stream, no
Writeis pending and the transport waits in the request body'sRead.Dothen doesn't return until the caller callsClose. This predates the change. dnclient always callsClosein a defer, so it isn't affected.Merge Danger
Door: two-way
Blast Radius: small
Only the streaming path changes.
Writeafter the request ends now returns an error instead of blocking.