From d621d7fc29f0a76aecb4880001f34031c80b87ac Mon Sep 17 00:00:00 2001 From: Daniel Hilst <392820+dhilst@users.noreply.github.com> Date: Thu, 30 Jul 2026 19:03:00 -0300 Subject: [PATCH] fix(xcat-core): treat signal-killed build workers as failures too The parallel-build failure gate only inspected $exit_code in run_on_finish. A ForkManager child killed by a signal -- SIGKILL, or the OOM-killer under the concurrent build load -- is reaped with $exit_code == 0 but $exit_signal != 0 (and possibly $core_dump). Such a worker therefore was NOT recorded as a failure, so the parent could still index and GPG-sign a repository that is missing the package that worker was building -- the exact partial-repo hazard the gate was added to prevent, via a path it did not cover. Capture $exit_signal and $core_dump from the run_on_finish callback and fail the build when any of $exit_code, $exit_signal, or $core_dump is set. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com> --- buildrpms.pl | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/buildrpms.pl b/buildrpms.pl index 7ddc775d3..0304de400 100755 --- a/buildrpms.pl +++ b/buildrpms.pl @@ -999,11 +999,13 @@ sub main { local $SIG{TERM} = \&abort_builds; $pm->run_on_start(sub { my ($pid, $chroot) = @_; $MOCK_INFLIGHT{$pid} = $chroot if defined $chroot; }); $pm->run_on_finish(sub { - my ($pid, $exit_code, $ident) = @_; + my ($pid, $exit_code, $ident, $exit_signal, $core_dump) = @_; delete $MOCK_INFLIGHT{$pid}; - # A build/update child that die()s (e.g. a failed sh_retry) exits non-zero; record it so - # we never index or sign a partial repository (would ship a core missing packages). - push @CHILD_FAILURES, ($ident // "pid=$pid") if $exit_code; + # A child that die()s exits non-zero; one killed by a SIGNAL (SIGKILL / OOM-killer) is reaped + # with $exit_code==0 but $exit_signal!=0 (and maybe $core_dump). Checking $exit_code alone + # would let an OOM-killed worker through and the parent would index+sign a partial repository + # (a core missing packages). Treat a non-zero exit, a killing signal, OR a core dump as failure. + push @CHILD_FAILURES, ($ident // "pid=$pid") if $exit_code || $exit_signal || $core_dump; }); for my $pair (@rpms) {