mirror of
https://github.com/xcat2/xcat-dep.git
synced 2026-09-12 12:36:23 +00:00
b435ae4bad
Every per-package build ran through a bare system() call with no wall-clock bound. Under qemu-user a build can deadlock -- a riscv64 goconserver `go build` held both Go pids in futex_wait for 26 minutes with no CPU ticks and no open socket -- and the step then never returns. The pipeline does not go red; it stops, and a stopped run reads as "still running". XCAT::BuildUtils::run_bounded runs the command in its own process group, kills that group when a budget expires, and prints first what the manual investigation had to collect by hand: the process tree, each pid's kernel wchan and stack, its open socket count, and the CPU ticks the group used across a 20-second sample. Zero ticks names a deadlock; ticks name a build that is only slow. BuildUtils::build_deb_in_chroot bounds every Ubuntu package build, and mockbuild-all.pl bounds the dep and perl steps of a forcearch target. The budget is 900 seconds for a native build and ten times that for a foreign architecture, because qemu-user under TCG runs at roughly a tenth of native speed. Both sit about five times above the slowest build measured on xcat-master-ub: 3 minutes native, and 26 minutes for riscv64 ipmitool-xcat on resolute with four codenames building at once. Native mock steps stay unbounded -- no measurement of them exists, and a guessed budget would turn a trusted cell red. sbuild-all.pl --build-timeout and mockbuild-all.pl --build-timeout override the default; 0 removes the bound. t/build_timeout.t fails without this change: run_bounded never returns and the test reports the hang instead of blocking. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>