sdk/python: bound every dial the DHT walk makes #532
All Vouch review confidence checks passed
Residual risk 0.15 = Change Risk (0.37) × (1 − Review Confidence (0.60)).
Review depth and reviewer attention state are adequate.
Model 1 · Change Risk (XGBoost)
Score: 0.37 · 231 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.326
Shallow Review Depth
shallow_review_depth
0.289
Real PR Conversation Timeline
1 comments
"Review active on #532"
general
weight: 0.35
aojea
Fixes the hub v0.1.0-rc.7 rollout and the bananas
maindeploys failing since fe2141c2 at "Deploy and run the SDK cold-path probe" (e.g. https://github.com/google/sam/actions/runs/36317528367/job/108643796199).What was happening
The Python
call.pyprobe printed nothing and sat until the Job deadline killed it, while the JS probe and the Python A2A agent in the same pod were fine. In the pod the process held one socket inSYN_SENT(9 retransmits) to the GCE VM router's public address, which the cluster network policy drops.find_peer/find_providersfollow the closer peers a router names with a barehost.connect. py-libp2p has no dial timeout of its own, so the SYN waited on the kernel, and since every in-cluster router names the dark router as closer to every key, the walk parked there before the first call could be answered. The session's own dials were already bounded byDIAL_TIMEOUT(15s); these were not.Changes
DIAL_TIMEOUT/dialmove tohost.pyand bound the closer-peer dials. A peer whose dial failed is remembered so the next rounds do not dial it again (three rounds would otherwise cost 3× the bound per lookup).host.disconnectafter a stalled stream open is bounded too: it writes a GO_AWAY on the very connection that stalled.tests/test_discovery.pydrives the walks against a fake router that names a dark closer peer: the pre-fix walk never returns, the fixed one dials once and ends atDIAL_TIMEOUT(MockClock, no wall time).probe.shruns each call undertimeout, so a hung program yields a stage failure carrying its last output instead of a silent Job deadline.Validation
sdk/python: 87 passedgo test ./tests/integration -run 'TestNativeSDK|TestSDK': all pass (incl.TestNativeSDKsAcrossRouters)make lint,make testgreen