better transient state handling
All checks were successful
Build and Deploy MITM Webserver / traffic_target (push) Successful in 0s
Build and Deploy MITM Webserver / build (push) Successful in 9s

This commit is contained in:
2026-03-09 18:05:52 +01:00
parent 234827f5bc
commit 6fa0ab0ee1

View File

@@ -268,8 +268,11 @@ class BridgeLinkStateWatcher:
for ifname in states for ifname in states
if self._config_changed(ifname, states, previous_states) if self._config_changed(ifname, states, previous_states)
) )
if changed_members: transition_seeds: list[str] = list(changed_members)
self._mark_config_changes(changed_members, now) if reason == "netlink_event" and source_ifname is not None and source_ifname in states:
transition_seeds.append(source_ifname)
if transition_seeds:
self._mark_config_changes(transition_seeds, now)
if failing_members: if failing_members:
config_source = self._find_config_sync_source(states, previous_states, preferred_ifname=source_ifname) config_source = self._find_config_sync_source(states, previous_states, preferred_ifname=source_ifname)
@@ -476,8 +479,9 @@ class BridgeLinkStateWatcher:
def _mark_config_changes(self, ifnames: list[str], now: float) -> None: def _mark_config_changes(self, ifnames: list[str], now: float) -> None:
"""Keep short-lived link flaps from config changes from being treated as failures.""" """Keep short-lived link flaps from config changes from being treated as failures."""
holdoff = max( holdoff = max(
settings.bridge_link_state_failure_holdoff_seconds, settings.bridge_link_state_failure_holdoff_seconds * 2,
self.recovery_holdoff_seconds, self.recovery_holdoff_seconds * 2,
1.5,
) )
with self._lock: with self._lock:
for ifname in ifnames: for ifname in ifnames: