Restore WireGuard tunnels after rapid reconnects and log QUIC closes
A peer can leave and return with the same WireGuard public key between reconciliation passes. The old reader then stays attached to a closed logical channel even though the carrier is up. Retain a tunnel only while its endpoint, announced key and open channel still match. Stop retired readers and start a handshake on the replacement channel. Carrier changes under the same channel keep the session and traffic counters. Record the newest channel before waking the worker, including while a network key is loading. A burst that fills the bounded command queue can now delay a sync without losing the channel the core handed over. Capture the QUIC close cause before local session cleanup. Include the network name and last known peer hostname alongside their IDs in the disconnect log. Report transport and application codes without copying arbitrary peer-supplied close text. The in-process disconnect event gains name fields. Mesh protocols, local IPC and storage formats stay compatible. On macOS arm64 both the loopback reconnect and close-code tests failed before the fix. The locked workspace suite now passes 606 tests with five opt-in tests ignored. It covers bidirectional IP after reconnect and a saturated notification queue. Formatting and strict workspace Clippy passed.
This commit is contained in:
1 parent
6a0a87e76c
commit
fb7a959d23
8 files changed
+299
-59
No files matched your search
@@ -5043,12 +5043,16 @@ fn log_event(event: &Event) {
|
||||
}
|
||||
Event::PeerDisconnected {
|
||||
network,
|
||||
network_name,
|
||||
peer,
|
||||
hostname,
|
||||
reason,
|
||||
} => {
|
||||
tracing::info!(
|
||||
network = %network.fmt_short(),
|
||||
network_name = network_name.as_str(),
|
||||
peer = %peer.fmt_short(),
|
||||
hostname = hostname.as_deref().map(tracing::field::debug),
|
||||
"Peer disconnected: {reason}"
|
||||
);
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user