mirror of
https://github.com/GNS3/gns3-server.git
synced 2026-08-27 12:30:13 +03:00
fix(marker): stop auto-deleting markers on node stop in node_updated
Markers are persistent link-scoped features (like packet filters), not transient runtime features (like capture). Tearing them down on every node stop breaks stop/start restore: the NIO-based re-application in _ubridge_apply_markers works correctly on restart, but node_updated was prematurely calling stop_marker which erased _markers state and dumped an empty topology. Now markers survive node stop transparently — the ubridge filter dies with the process but is re-added from nio.markers in add_ubridge_udp_connection when the node starts again, mirroring exactly how packet filters behave.
This commit is contained in:
parent
7c90fa9e64
commit
239f42f5aa
@ -321,10 +321,11 @@ class UDPLink(Link):
|
||||
"""
|
||||
if self._capture_node and node == self._capture_node["node"] and node.status != "started":
|
||||
await self.stop_capture()
|
||||
# Tear down any marker whose capture-side node just stopped.
|
||||
for name, marker_info in list(self._markers.items()):
|
||||
if marker_info.get("capture_node_id") == node.id and node.status != "started":
|
||||
await self.stop_marker(name)
|
||||
# Marker clean-up is *not* done on node stop — markers are a persistent
|
||||
# link-scoped feature that recovers via NIO on restart (see
|
||||
# _ubridge_apply_markers in add_ubridge_udp_connection). The user
|
||||
# explicitly deletes a marker via the REST API, and a marker is torn
|
||||
# down automatically only when its link is deleted.
|
||||
|
||||
def _capture_node_for_marker(self, name):
|
||||
"""Return the stored (node, adapter_number, port_number) for a marker's capture side."""
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user