bindings: stop mutating shared HTTP transport in exec attach #30421
All Vouch review confidence checks passed
Residual risk 0.04 = Change Risk (0.39) × (1 − Review Confidence (0.89)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.39 · 205 lines diff across 4 files
Model 2 · Review Depth (DistilBERT)
Depth Score: 0.89 · 3 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.319
Real PR Conversation Timeline
4 items
mheon
Elvand-Lie
What this PR does
Fixes two issues in
containers.ExecStartAndAttach:1. Avoids mutating the shared HTTP transport: Previously,
attach.gopermanently swapped the client's shared HTTP transport without a lock (noted in an existingFIXME), breaking concurrent attach calls. This change uses anhttptrace.ClientTraceGotConnhook to capture the underlying attach socket while leaving the shared transport untouched.2. Adds
DisableLocalTerminaloption: Even when a caller passes their ownInputStream,attach.gostill hard-codesos.Stdinfor terminal checks, raw mode (whenos.Stdinis a terminal and the exec session has a TTY), and resize handling. The new opt-inDisableLocalTerminaloption skips this local terminal handling and leaves the caller's terminal untouched.3. Aligns the exec start
Ttyfield: The exec start request'sTtyfield now follows the exec session's own TTY setting rather than the local terminal check.Testing
mainas written (due toWithDisableLocalTerminal), and fails onmainwith"replaced the shared HTTP transport"if that option call is removed.-race, both standalone and across the fullbindings/containerspackage.Fixes: #25090
<!-- Thanks for sending a pull request! -->
Checklist
Ensure you have completed the following checklist for your pull request to be reviewed:
<!-- Use [x] to mark as done, or click the checkbox after opening PR -->
commits. (
git commit -s). (If needed, usegit commit -s --amend). The author email must matchthe sign-off email address. Read the DCO Sign-off requirements
and ensure you follow them before signing off your commits.
Fixes: #00000in commit message (if applicable)make validatepr(format/lint checks)Noneif no user-facing changes)Does this PR introduce a user-facing change?
<!--
Write
Noneif there are no user-facing changes, otherwise enter your release note below.Include "action required" if users need to take action when upgrading.
-->
``
release-noteExecStartAndAttachFixed a race condition in the Go bindings where
mutated the shared HTTP transport, and added aDisableLocalTerminaloption to skip localos.Stdinterminal handling.
``