fix: revive the connection-timeout watchdog (== for =) #109
Loading…
Reference in a new issue
No description provided.
Delete branch "fix/conn-timeout-watchdog"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
The three
starting_timerhandlers heldself.tunnel_active == 0— comparisons where assignments were meant — so arming the 15s watchdog never marked the tunnel pending.timeout()only kills a tunnel whose flag is still 0 when the timer fires; after a session's first successful connection the flags stayed 1, and every later hung connect/reconnect attempt just spun the cursor forever (#103).start_timeradditionally reset the bypass flag whatever tunnel was starting.Fix
=for==in all three handlers; the stray bypass-flag line instart_timeris deleted — each handler resets exactly its own flag.kill_hopgains its missingself: with the watchdog able to reach its kill path,getattr(self, "kill_hop")()on a hung hop attempt raised TypeError inside a Qt slot, which aborts the GUI.Behavior change, bounded: the 15-second deadline on connection attempts now actually enforces — a hung attempt gets torn down via the existing
kill*paths instead of spinning. The boundaries checked:starting_timeris emitted once per openvpn spawn (tunnel.py:625), never on management reconnect events, so ping-restart recovery is never killed;dispatch_statusstops the timer on any arriving status; established tunnels set their flag to 1 and are spared; the #102tunnel_terminatedguard is unaffected (the connect path already hadtunnel_active = 0viakill()before arming).Verification
Ten new tests: arming resets exactly its own flag and starts the 15s timer (×3 roles), armed-then-fired kills the pending tunnel (×3), an established tunnel is spared (×3), and
kill_hopis callable as a method. Full suite: 197 passed.Closes #103
🤖 Generated with Claude Code