mirror of
https://github.com/jmcorgan/fips.git
synced 2026-10-06 03:28:24 +00:00
A link flap set 100% loss on each direction and saved the previous netem arguments in LinkManager. Nothing else knew about the flap, so two other paths re-shaped a flapped link and ended the flap early: a node restart's setup_node re-installed the link's normal parameters, and a netem mutation or link swap (_update_link) replaced the qdisc mid-flap. Scenarios with flaps plus churn or mutation (churn-mixed, ethernet-mesh, tcp-mesh) therefore saw shorter outages than they declared. The flap is now a held_down flag on the NetemManager's per-direction state, and tc_args() returns "loss 100%" while it is set. setup_node installs tc_args(), so a restarted node keeps a flapped link down. _update_link only records new parameters on a held direction, and link-up installs them, so a mutation during a flap takes effect when the flap ends. The flag is set and cleared whether or not the container is running, and whether tc is issued now is decided by the live running check alone. The NetemManager's down_nodes set is not used for that: on this branch it is never cleared when a node restarts (NodeManager keeps a private copy), so a node stopped during a flap would otherwise keep its direction at 100% loss after restart and link-up. Known limits on this branch: a node restart recreates each Ethernet veth pair and only the restarted end is re-shaped, so the surviving end of a flapped Ethernet link passes traffic until the flap ends (UDP and TCP flaps are held on both ends); and a node marked in down_nodes once stays excluded from later flaps and mutations for the rest of the run. Both predate this change.