fix(gool): reconnect without stopping to ask a question - #98
Open
amir-reza-bijandi wants to merge 1 commit into
Open
fix(gool): reconnect without stopping to ask a question#98amir-reza-bijandi wants to merge 1 commit into
amir-reza-bijandi wants to merge 1 commit into
Conversation
run_gool asked for the scan mode and the ip version from inside its reconnect loop, so every rescan after two failed reconnects stopped at a prompt. Hours into a session there is nobody at the terminal to answer it, and a tunnel that dropped never came back: the log ends on "blacklisting and rescanning" with the scan mode menu sitting under it. Ask once before the loop, the way run_masque and run_wireguard already do. The first pass through the loop always scans, so the question is still asked at the same point it was before; the passes after it reuse the answer instead of asking again. Reported on CluvexStudio#91. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
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.
Reported by @TheLordOfTheKings on #91: with gool, a tunnel that drops after a long session never comes back.
What happens
The reconnect loop runs, and then stops at a prompt:
run_goolasks for the scan mode and the IP version from inside its reconnect loop, so every rescan waits on stdin. A drop hours into a session has nobody there to answer, and the tunnel stays down. One drop retries the same endpoint quietly; two consecutive drops blacklist it, go to rescan, and hang there.Not a regression from #91
This is older than that fix. The loop has prompted on rescan since
a26159b(v1.6.0), where it calledselect_peer, which asks both questions;38bc38freplaced that call with the two prompts directly, still inside the loop. #91 only changed the teardown inrun_warp_in_warp.What #91 changed is which failure you meet first: before it, the first stale tunnel panicked and took the process with it, so the rescan was never reached. The log above is that fix working — two full loop passes where the old code would have crashed on the first — and it uncovered the prompt behind it.
The fix
Ask once before the loop, the way
run_masqueandrun_wireguardalready do. The first pass through the loop always scans, so the question is asked at the same point it was before; later passes reuse the answer instead of asking again.Setting
--scanand-4/-6/--dual(orAETHER_SCAN/AETHER_IP) already avoided this, since those suppress the prompts — that's the workaround for anyone on 1.8.0.Testing
cargo testpasses (234 tests) and the build is clean. I haven't reproduced a live tunnel drop, so the reconnect path itself is code review rather than a demonstration.A note on this PR
Full disclosure: as with #91 I put this together with Claude Code, and I don't know Rust myself, so please review it as such.