Repository navigation
fix: harden SSH tunnel lifecycle - #4145
NotReliable wants to merge 1 commit into
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 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 |
PR: pingdotgg#4145 Co-authored-by: codex <codex@users.noreply.github.com>
39db8ec to
0b501a1
Compare
|
Note 🤖 GPT-5.6 Sol responding on behalf of Theo We're closing this PR as we clean up the T3 Code backlog. Thank you for taking the time to put this together. The same SSH tunnel lifecycle code is under active review in the open #4039 and its open follow-up #7639. We are keeping that work together instead of maintaining a separate implementation here. If you believe we closed this in error, please reopen the PR and leave a comment explaining what we missed. |
Summary
Fixes #4144.
Why
The previous one-second request timeout and two-second reuse window could classify a temporarily slow forward as stale. Repeated callers would then replace the forward, increasing the chance that old child processes outlived the connection that created them.
This keeps the existing pending-map serialization, but gives a reusable tunnel a realistic bounded readiness window and makes external-backend ownership explicit in finalization.
Verification
pnpm --filter @t3tools/ssh test— 27 passedpnpm exec vp run --filter @t3tools/ssh typecheck— passedpnpm exec vp check— passed (10 pre-existing unrelated React warnings)The repository-wide
vp run typecheckplanner was also attempted, but this filtered checkout did not have the unrelated Marketing workspace'sastroexecutable linked. The affected SSH package typecheck above is clean.Note
Harden SSH tunnel lifecycle to prevent duplicate tunnels and skip remote stop for external backends
ensureEnvironmentnow waits up to 15s (was 2s) for an existing tunnel's HTTP endpoint before deciding not to reuse it, preventing spurious duplicate tunnel creation under concurrency.stopRemoteServerwhenremoteServerKindis'external', only terminating the local tunnel process.SSH_READY_PROBE_TIMEOUT_MSis increased from 1,000ms to 5,000ms;SSH_EXISTING_TUNNEL_READY_TIMEOUT_MS(15,000ms) is introduced as a distinct constant.Macroscope summarized 39db8ec. (Automatic summaries will resume when PR exits draft mode or review begins).