Commit 26824f4
committed
Make tunnel-handshake startup transient instead of fatal
Symptom: 'pilotctl ping <peer>' or any first send to a peer immediately
after a daemon restart could return 'send SYN: pending queue full for
node X: oldest packet dropped' and abort. The user sees a hard failure
even though the daemon is only 1-2 RTTs away from a working tunnel.
Root cause: tunnel.go appended the new packet to the pending queue
(success), then returned an error solely to surface that an older
packet had been dropped to make room. DialConnection's first-SYN
send-error path bailed on any error, so it never reached its 6-retry
loop — the SYN it just successfully queued never got retransmitted.
Changes:
* pkg/daemon/tunnel.go: define typed sentinel ErrPendingDropped and
return it (wrapped) from sendEncryptedToNode when the new packet is
queued but the oldest had to be dropped.
* pkg/daemon/daemon.go DialConnection: errors.Is(err, ErrPendingDropped)
→ log debug, fall through to the existing SYN retransmit loop.
Treat any other Send error as fatal as before.
* cmd/pilotctl/main.go: classifyDaemonError() recognizes the
pending-queue and dial-timeout patterns and emits an actionable hint
("tunnel handshake in progress — retry in a few seconds" /
"no reply from peer; relay can take ~30s to converge after a beacon
roll") instead of the generic 'check ping' boilerplate. Wired into
the connect/send-message dial sites.
* pkg/beacon/server.go: drop a stray 'pi' typo on line 1 that was
blocking the build (intentional gossip changes preserved).1 parent 7d728ec commit 26824f4
3 files changed
Lines changed: 71 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
97 | 97 | | |
98 | 98 | | |
99 | 99 | | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
100 | 126 | | |
101 | 127 | | |
102 | 128 | | |
| |||
2418 | 2444 | | |
2419 | 2445 | | |
2420 | 2446 | | |
2421 | | - | |
2422 | | - | |
| 2447 | + | |
| 2448 | + | |
| 2449 | + | |
| 2450 | + | |
| 2451 | + | |
2423 | 2452 | | |
2424 | 2453 | | |
2425 | 2454 | | |
| |||
2771 | 2800 | | |
2772 | 2801 | | |
2773 | 2802 | | |
2774 | | - | |
2775 | | - | |
| 2803 | + | |
| 2804 | + | |
| 2805 | + | |
| 2806 | + | |
| 2807 | + | |
2776 | 2808 | | |
2777 | 2809 | | |
2778 | 2810 | | |
| |||
2832 | 2864 | | |
2833 | 2865 | | |
2834 | 2866 | | |
2835 | | - | |
2836 | | - | |
| 2867 | + | |
| 2868 | + | |
| 2869 | + | |
| 2870 | + | |
| 2871 | + | |
2837 | 2872 | | |
2838 | 2873 | | |
2839 | 2874 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2412 | 2412 | | |
2413 | 2413 | | |
2414 | 2414 | | |
2415 | | - | |
2416 | | - | |
| 2415 | + | |
| 2416 | + | |
| 2417 | + | |
| 2418 | + | |
| 2419 | + | |
| 2420 | + | |
| 2421 | + | |
| 2422 | + | |
| 2423 | + | |
| 2424 | + | |
| 2425 | + | |
| 2426 | + | |
2417 | 2427 | | |
2418 | 2428 | | |
2419 | 2429 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
253 | 266 | | |
254 | 267 | | |
255 | 268 | | |
| |||
1808 | 1821 | | |
1809 | 1822 | | |
1810 | 1823 | | |
1811 | | - | |
| 1824 | + | |
| 1825 | + | |
| 1826 | + | |
| 1827 | + | |
| 1828 | + | |
1812 | 1829 | | |
1813 | 1830 | | |
1814 | 1831 | | |
| |||
0 commit comments