diff --git a/pr/3967/docs/src/iroh/socket/remote_map/remote_state.rs.html b/pr/3967/docs/src/iroh/socket/remote_map/remote_state.rs.html index a2a29eb4be..5793ec820a 100644 --- a/pr/3967/docs/src/iroh/socket/remote_map/remote_state.rs.html +++ b/pr/3967/docs/src/iroh/socket/remote_map/remote_state.rs.html @@ -948,50 +948,50 @@ 948 949 self.select_path(); 950 } -951 PathEvent::Discarded { id, path_stats } => { -952 trace!(%id, ?path_stats, "path discarded"); -953 } -954 PathEvent::Abandoned { id, .. } => { -955 // This is the last event for this path: remove from conn_state. -956 let Some(path_remote) = conn_state.remove_path(&id) else { -957 debug!(%id, "path not in path_id_map"); -958 return; -959 }; -960 // Also remove the path from the remote-global path tracking. -961 self.paths.abandoned_path(&path_remote); -962 -963 event!( -964 target: "iroh::_events::path::closed", -965 Level::DEBUG, -966 remote = %self.endpoint_id.fmt_short(), -967 ?path_remote, -968 ?conn_id, -969 path_id = ?id, -970 ); -971 -972 // If one connection closes this path, close it on all connections. -973 for (conn_id, conn_state) in self.connections.iter_mut() { -974 let Some(path_id) = conn_state.paths_by_addr.get(&path_remote) else { +951 PathEvent::Abandoned { id, .. } => { +952 // Remove abandoned path from the conn state. +953 let Some(path_remote) = conn_state.remove_path(&id) else { +954 debug!(%id, "path not in path_id_map"); +955 return; +956 }; +957 // Also remove the path from the remote-global path tracking. +958 self.paths.abandoned_path(&path_remote); +959 +960 event!( +961 target: "iroh::_events::path::abandoned", +962 Level::DEBUG, +963 remote = %self.endpoint_id.fmt_short(), +964 ?path_remote, +965 ?conn_id, +966 path_id = ?id, +967 ); +968 +969 // If one connection abandones a path, close it on all connections. +970 for (conn_id, conn_state) in self.connections.iter_mut() { +971 let Some(path_id) = conn_state.paths_by_addr.get(&path_remote) else { +972 continue; +973 }; +974 let Some(conn) = conn_state.handle.upgrade() else { 975 continue; 976 }; -977 let Some(conn) = conn_state.handle.upgrade() else { -978 continue; -979 }; -980 if let Some(path) = conn.path(*path_id) { -981 trace!(?path_remote, ?conn_id, %path_id, "closing path"); -982 if let Err(err) = path.close() { -983 trace!( -984 ?path_remote, -985 ?conn_id, -986 %path_id, -987 "path close failed: {err:#}" -988 ); -989 } -990 } -991 } -992 -993 // If the remote closed our selected path, select a new one. -994 self.select_path(); +977 if let Some(path) = conn.path(*path_id) { +978 trace!(?path_remote, ?conn_id, %path_id, "closing path"); +979 if let Err(err) = path.close() { +980 trace!( +981 ?path_remote, +982 ?conn_id, +983 %path_id, +984 "path close failed: {err:#}" +985 ); +986 } +987 } +988 } +989 +990 // If the remote closed our selected path, select a new one. +991 self.select_path(); +992 } +993 PathEvent::Discarded { id, path_stats } => { +994 trace!(%id, ?path_stats, "path discarded"); 995 } 996 PathEvent::RemoteStatus { .. } | PathEvent::ObservedAddr { .. } => { 997 // Nothing to do for these events.