Skip to content

fix(gool): reconnect without stopping to ask a question - #98

Open
amir-reza-bijandi wants to merge 1 commit into
CluvexStudio:mainfrom
amir-reza-bijandi:fix/gool-reconnect-without-a-prompt
Open

fix(gool): reconnect without stopping to ask a question#98
amir-reza-bijandi wants to merge 1 commit into
CluvexStudio:mainfrom
amir-reza-bijandi:fix/gool-reconnect-without-a-prompt

Conversation

@amir-reza-bijandi

Copy link
Copy Markdown
Contributor

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:

[-] gool tunnel ended: other: [inner] other: wireguard tunnel stale: no valid data from peer; reconnecting
[-] outer endpoint 162.159.192.1:2408 failed 2 times in a row; blacklisting and rescanning

Scan mode:
  [1] turbo     (fast, first hit)
...
Choose [1-5] (default 2):

run_gool asks 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 called select_peer, which asks both questions; 38bc38f replaced that call with the two prompts directly, still inside the loop. #91 only changed the teardown in run_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_masque and run_wireguard already 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 --scan and -4/-6/--dual (or AETHER_SCAN / AETHER_IP) already avoided this, since those suppress the prompts — that's the workaround for anyone on 1.8.0.

Testing

cargo test passes (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.

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>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant