mirror of
https://github.com/xcat2/xcat-core.git
synced 2026-11-25 20:02:19 +00:00
1e80f766ac
BuildUtils::sh() runs each build command in its own process group, so SIGKILL on the wrapper leaves that group running. A lock recovered from the dead wrapper then lets a second build into the same checkout, and cancel_build's retention is undone by the same recovery: it keeps the lock when workers survive, and the next build reads a dead owner and takes it. build_lock_stale_owner.t covers a wrapper and nothing below it. The name reads wider than the check: the holder it kills has no build worker, so the worker case was never measured. Its comment says so now. A new check is the reviewer's case. A worker runs in its own process group, a wrapper takes the build lock and records it, the wrapper alone is killed, and a second build must stay blocked. Then the worker exits and the same build must take the lock: without that half, a lock that recovers nothing would pass. The handshake is two one-byte reads on separate pipes, each bounded. One read of two bytes made it a timing test, which passed on this host and killed the wrapper before it held the lock. The vendored XCAT::NFSLock gains attach, detach and live_workers, which these checks drive. Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>