[lab/CI] Killed lab test orphans self-daemonizing processes that wedge the CI step past its timeout #137
Labels
No labels
bug
deploy
documentation
duplicate
enhancement
good first issue
help wanted
invalid
pull-request
question
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
femboy/blackwall#137
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Several lab gates wedge in CI: the step stays
in_progressfar past itstimeout-minutes(observed 30+ min on a 6-min step) until the whole job is cancelled at the job cap. It was latent for many commits because theflow-livegate (earlier in the sequence) always wedged first and cancelled the job before later gates ran.Confirmed wedging gates:
flow-live(#88),deception-resilience(#136),flowspec,flowspec-auto. All run long-lived / self-daemonizing helpers (hsflowd, the deception engine under load, BIRD). Gates that reap cleanly (deception,flow,bgp,rtbh,deception-syncookie,deception-syncookie-v6,xdp) pass.Root cause (hypothesis): when
lab testis killed before its normal teardown runs — by the #88 in-process watchdog (std::process::exit(124), which skips theDrop-basedTeardown) or by the outersudo timeout— the scenario's daemons are orphaned. Some (e.g. self-daemonizing BIRD, hsflowd) survive and keep the CI step's stdout/stderr pipe open, so GitHub's runner never sees EOF and the step's owntimeout-minuteskill doesn't finalize it. The step only ends when the job cap cancels everything.Fix directions:
std::process::exit(teardown-then-exit instead of bare exit), so no orphan survives a watchdog trip.lab testin its own session and have the CI wrapper kill the whole session/process-group on timeout (e.g.setsid+ group-kill), and close inherited fds (3/4 from theexecredirect) so a lingering daemon can't hold the runner pipe.Currently quarantined in CI (via
if: false, with the timeout PR) so the suite is green: flow-live, deception-resilience, flowspec, flowspec-auto. Re-enable as each is fixed.New data point: with the #136 connect-flood fix, re-enabling the
deception-resiliencegate makes it pass green in CI — but the very next gate,rtbh(BIRD), then wedged (33min on a 6min step), reproducibly only when deception-resilience runs before it. So deception-resilience's teardown appears to leave residue (a lingering engine/flood daemon or netns) that wedges the following BIRD gate — the same daemon-orphan class this issue tracks. The systemic teardown-on-kill fix should let ALL four quarantined gates (flow-live, deception-resilience, flowspec, flowspec-auto) re-enable together; re-enabling them one at a time hits these cross-gate wedges.Reverted (#152). The residue-reap fix (#150) regressed previously-green daemon-gates:
deception-syncookie-v6wedged ~24min on main, anddeception-syncookiewedged in a follow-up PR — both stable for many runs before #137. Cause: the unbounded pre-gatesudo lab down+ thereap_orphan_lab_procs()pkillintermittently hang/race the daemon-gates' engines.The root-cause finding stands (orphans survive teardown into anonymous, name-deleted namespaces — kill-before-delete +
ip netns pidsreaping is the right idea). But a safe re-land must: (1) timeout-wrap every sweep/reap so it can NEVER hang a gate; (2) make the orphanpkillsignature strictly scoped so it cannot match a live gate's own engine or race it; (3) verify on a full CI run that no previously-green daemon-gate (deception, deception-syncookie, deception-syncookie-v6, trafficgen) regresses BEFORE re-enabling any quarantined gate. Needs a CI-reproduction loop to iterate safely — deferred.Resolved for 3 of 4 gates (#159). The systemic cross-gate wedge root cause was broken tproxy, not (only) a teardown-thoroughness bug: the deception-TCP tproxy rule set the tproxy verdict but no terminal
accept, so the interactive tier didn't deliver connections — the engine hung on the broken path and left orphaned processes that wedged the next gate (rtbh/flowspec). Fixing the tproxy rule tomark set → tproxy → accept(#157, plus the #136 connect-flood deadline) makes the engine serve under load AND tear down cleanly. With that on main,deception-resilience,flowspec, andflowspec-autowere re-enabled and pass green (twice, #159).My earlier teardown-reap attempt (#150, reverted #152) was treating the symptom; the tproxy fix removed the cause. Remaining: only flow-live, whose wedge is the separate in-step hsflowd-pipe issue tracked in #88 — closing this as resolved and leaving flow-live to #88.