Fix SSH tunnel not restarted on unexpected process exit#133
Closed
Fix SSH tunnel not restarted on unexpected process exit#133
Conversation
- Add TunnelExited event to SshTunnelService - Null _process/_lastSpec and dispose the process on unexpected exit, then fire TunnelExited - Subscribe to TunnelExited in App.xaml.cs with bounded retry backoff (1s/2s/5s/10s/30s) Agent-Logs-Url: https://github.com/openclaw/openclaw-windows-node/sessions/a69d5952-fc73-46fe-9d2b-e5596c75ea4c Co-authored-by: shanselman <2892+shanselman@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix SSH tunnel not restarted on unexpected exit
Fix SSH tunnel not restarted on unexpected process exit
Apr 1, 2026
This was referenced Apr 2, 2026
Collaborator
|
Superseded by PR #141 (merged) — SSH tunnel restart fix. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
When the SSH tunnel process crashed,
SshTunnelServiceonly logged a warning — it never cleaned up_process/_lastSpec, never fired an event, and never attempted a restart. The gateway client's reconnect loop would spin indefinitely against a dead localhost port.Changes
SshTunnelServiceTunnelExitedevent, raised only on unexpected exits (not on intentionalStop())_processand_lastSpec(so the nextEnsureStartedstarts fresh), disposes the dead process object (fixes a resource leak), then firesTunnelExitedApp.xaml.csTunnelExitedat service creationOnSshTunnelExitedretriesEnsureSshTunnelConfigured()with bounded backoff (1 s → 2 s → 5 s → 10 s → 30 s); aborts early if the app is exiting or SSH tunnel is disabled. The gateway client's existing reconnect loop recovers automatically once the tunnel port is live again.