mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-25 20:02:19 +00:00
107117b90d
The build lock is recovered from a dead owner when no recorded process group is alive. sh() let the command exec before the parent recorded its group, and attach_build_workers() ignored a failed record, so a parent killed in that window left a running command on a lock that the next build recovers. buildrpms.pl kept its Perl builders only in %MOCK_INFLIGHT, so between two sh() calls a builder had no record and a killed parent freed the lock under it. start_build_worker() forks the worker into its own process group and holds it on a pipe. The parent records the group on every held lock and only then writes to the pipe. A failed record, or a parent that dies first, makes the worker exit with status 127 before it runs. sh() and both ForkManager loops in buildrpms.pl start their workers this way, and run_on_finish detaches a builder once it is reaped. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>