fix(remoteingress-core): preserve reconnected edge entries during disconnect cleanup
This commit is contained in:
@@ -1073,7 +1073,11 @@ async fn handle_edge_connection(
|
||||
).await;
|
||||
{
|
||||
let mut edges = connected.lock().await;
|
||||
edges.remove(&edge_id);
|
||||
// Only remove if the entry is still ours (not replaced by a reconnection).
|
||||
// A replaced entry has a fresh non-cancelled token from the new handler.
|
||||
if edges.get(&edge_id).map_or(false, |e| e.cancel_token.is_cancelled()) {
|
||||
edges.remove(&edge_id);
|
||||
}
|
||||
}
|
||||
let _ = event_tx.try_send(HubEvent::EdgeDisconnected {
|
||||
edge_id: edge_id.clone(),
|
||||
@@ -1534,7 +1538,11 @@ async fn handle_edge_connection_quic(
|
||||
|
||||
{
|
||||
let mut edges = connected.lock().await;
|
||||
edges.remove(&edge_id);
|
||||
// Only remove if the entry is still ours (not replaced by a reconnection).
|
||||
// A replaced entry has a fresh non-cancelled token from the new handler.
|
||||
if edges.get(&edge_id).map_or(false, |e| e.cancel_token.is_cancelled()) {
|
||||
edges.remove(&edge_id);
|
||||
}
|
||||
}
|
||||
let _ = event_tx.try_send(HubEvent::EdgeDisconnected {
|
||||
edge_id,
|
||||
|
||||
Reference in New Issue
Block a user