Repository navigation
Fix Iroh release-gate readiness race - #8493
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughMac attach readiness now validates attach-ticket minting after the tagged socket appears. A relaunch test covers delayed minting, and the Iroh release gate passes the physical-device target. ChangesMac attach readiness
Estimated code review effort: 3 (Moderate) | ~20 minutes Sequence Diagram(s)sequenceDiagram
participant ReleaseGate
participant cmux_attach_ensure_mac
participant TaggedMacSocket
participant cmux_attach_mint_url
ReleaseGate->>cmux_attach_ensure_mac: Ensure physical-device Mac attach
cmux_attach_ensure_mac->>TaggedMacSocket: Poll for tagged socket
TaggedMacSocket-->>cmux_attach_ensure_mac: Socket becomes ready
cmux_attach_ensure_mac->>cmux_attach_mint_url: Mint attach URL
cmux_attach_mint_url-->>cmux_attach_ensure_mac: Return usable URL
cmux_attach_ensure_mac-->>ReleaseGate: Return success
Possibly related PRs
Suggested reviewers: Important Pre-merge checks failedPlease resolve all errors before merging. Addressing warnings is optional. ❌ Failed checks (1 error, 1 warning)
✅ Passed checks (23 passed)
✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Greptile SummaryThis PR fixes a race condition in the Iroh release gate where the Mac debug socket could appear before the broker completed registration, causing
Confidence Score: 5/5Safe to merge. The change correctly gates Mac readiness on Iroh route presence and is well-covered by new and existing tests. The post-launch path in No files require special attention. Important Files Changed
Flowchart%%{init: {'theme': 'neutral'}}%%
flowchart TD
A[cmux_attach_ensure_mac called] --> B{Socket exists?}
B -- yes --> C[Quick probe: cmux_attach_mint_url\n2 attempts]
C -- URL returned --> D[return 0 ✓]
C -- empty --> E{CMUX_ATTACH_ALLOW_RELAUNCH=1?}
E -- no --> F[warn + return 1 ✗]
E -- yes --> G[pkill tagged app\nwait for socket to clear]
G --> H[open tagged app]
B -- no --> H
H --> I{Socket appears\nwithin 60 × 0.2 s?}
I -- no --> J[warn: socket never appeared\nreturn 1 ✗]
I -- yes --> K{repo_root set?}
K -- no --> D
K -- yes --> L[cmux_attach_mint_url\nMINT_MAX_ATTEMPTS attempts\n0.5 s each]
L -- URL returned --> D
L -- empty after all attempts --> M[warn: Iroh ticket not ready\nreturn 1 ✗]
%%{init: {'theme': 'base', 'themeVariables': {"darkMode": true, "background": "#0d1117", "primaryColor": "#21262d", "primaryTextColor": "#e6edf3", "primaryBorderColor": "#8b949e", "lineColor": "#8b949e", "textColor": "#e6edf3", "edgeLabelBackground": "#161b22", "actorBkg": "#21262d", "actorBorder": "#8b949e", "actorTextColor": "#e6edf3", "actorLineColor": "#8b949e", "signalColor": "#8b949e", "signalTextColor": "#e6edf3", "noteBkgColor": "#373320", "noteBorderColor": "#d4a72c", "noteTextColor": "#f0e6c0", "labelBoxBkgColor": "#21262d", "labelBoxBorderColor": "#8b949e", "labelTextColor": "#e6edf3", "loopTextColor": "#e6edf3", "activationBkgColor": "#30363d", "activationBorderColor": "#8b949e"}}}%%
flowchart TD
A[cmux_attach_ensure_mac called] --> B{Socket exists?}
B -- yes --> C[Quick probe: cmux_attach_mint_url\n2 attempts]
C -- URL returned --> D[return 0 ✓]
C -- empty --> E{CMUX_ATTACH_ALLOW_RELAUNCH=1?}
E -- no --> F[warn + return 1 ✗]
E -- yes --> G[pkill tagged app\nwait for socket to clear]
G --> H[open tagged app]
B -- no --> H
H --> I{Socket appears\nwithin 60 × 0.2 s?}
I -- no --> J[warn: socket never appeared\nreturn 1 ✗]
I -- yes --> K{repo_root set?}
K -- no --> D
K -- yes --> L[cmux_attach_mint_url\nMINT_MAX_ATTEMPTS attempts\n0.5 s each]
L -- URL returned --> D
L -- empty after all attempts --> M[warn: Iroh ticket not ready\nreturn 1 ✗]
Reviews (1): Last reviewed commit: "fix(iroh): await trusted Mac route after..." | Re-trigger Greptile |
Summary
Verification
node --test scripts/lib/mobile-attach.test.mjs(30/30)bash -n scripts/lib/mobile-attach.sh scripts/run-iroh-release-gate.shgit diff --checkThe previous current-main hosted run failed automatic and relay-only because the Mac debug socket appeared before broker registration could mint a trusted Iroh ticket.
Need help on this PR? Tag
/codesmithwith what you need. Autofix is disabled.Summary by cubic
Fix release-gate readiness race by waiting for a trusted Iroh ticket after the tagged Mac app launches or relaunches. This prevents the gate from proceeding when only the debug socket exists.
cmux_attach_ensure_macbefore reporting Mac ready; add bounded retries viaCMUX_ATTACH_MINT_MAX_ATTEMPTS.scripts/run-iroh-release-gate.sh, require a trusted route before proceeding and setCMUX_ATTACH_MINT_MAX_ATTEMPTS=120; switch tophysical_device.Written for commit 259b4e6. Summary will update on new commits.
Summary by CodeRabbit