Parallel::ForkManager does not fork when max_procs is 0: start()
returns 0 in the original process. start_build_worker took that 0 as a
forked worker. It closed the only writer of the gate pipe, read
end-of-file and exited 127, so both worker loops in buildrpms.pl
stopped before they built a package or updated a repository.
start_build_worker now compares $$ before and after the fork callback.
When the callback returned 0 in the same process, it closes the gate and
returns 0, and the caller runs the work under the locks it already
holds. Both loops call start_build_worker, so both are covered.
build_worker_nofork.t passes with this change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Parallel::ForkManager does not fork when max_procs is 0: start()
returns 0 in the original process, and the caller runs the work there.
buildrpms.pl passes --nproc to ForkManager and starts each worker
through start_build_worker. That helper takes the 0 as a forked worker,
closes the only writer of the gate pipe, reads end-of-file and exits
127 before any package work.
The test starts one worker through a ForkManager with max_procs 0 and
checks that the work runs in the original process and process group,
with --nproc=1 as the control. It fails on this tree: the process exits
127.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
start_build_worker writes one byte to the gate pipe to release a worker
after the build lock records its group. When the worker dies between the
record and that write, the pipe has no reader and the write raises
SIGPIPE. The default disposition ends the builder at once, so its
cleanup never runs: the Debian package tree is not restored and the lock
is not released.
Ignore SIGPIPE for that one write. The write then fails with EPIPE and
start_build_worker reports the worker as not released, which is the
existing failure path. build_worker_gate_sigpipe.t passes with this
change.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
start_build_worker releases a gated worker by writing one byte to a
pipe. When the worker dies after the lock records its group and before
that write, the pipe has no reader, and the write raises SIGPIPE. The
default disposition ends the builder, which skips the cleanup that
restores the Debian package tree and releases the build lock.
The test kills the worker inside the record step and checks that the
builder exits normally and reports the worker as not released. It fails
on this tree: the builder ends on signal 13.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xcat_pr_test fails in release_repository.t with "retained for surviving
build workers in process group 1". The schedule stub in that test
returns 1 from Parallel::ForkManager::start. start_build_worker()
accepted ESRCH from setpgid() and recorded group 1 on the build lock.
Group 1 is always alive, so the next buildrpms.pl run in the same lock
directory is refused.
ESRCH means the pid is not a child of this process. The gated child, if
there is one, has not run, so start_build_worker() now records nothing
and reports failure. It also no longer writes to a gate that no child
reads.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
start_build_worker() treats ESRCH from setpgid() as a child that has
already gone, and records the pid on every held lock. When the fork
callback returns a pid that is not a child of the build, the lock
records a group that can stay alive forever, and every later build is
refused. release_repository.t hits this: its stub of
Parallel::ForkManager::start returns 1, and the lock then names
process group 1.
The new check passes a fork callback that returns the parent pid and
asserts that no held lock records it. It fails on the current tree.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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>
A build lock whose owner is dead is recovered unless it records a live
process group. sh() starts the command before the parent records its
group, and it ignores a record that fails. buildrpms.pl forks its Perl
builders with Parallel::ForkManager and records none of them. In each
case a worker can outlive a killed parent, and a second build then
takes the lock while the first one still writes.
build_lock_worker_registration.t covers the three cases: a record that
fails, a parent that dies before it records, and a ForkManager builder
whose parent is killed. On the unfixed tree the first two run the
command and the third has no start_build_worker to call.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Clean against the master that now carries xcat-core/#7968, #7970, #7971, #7975,
#7978 and #7980. #7968 touches buildrpms.pl and release_repository.t as this
branch does, in disjoint regions -- the locking sites here, createrepo_dir,
index_repo and sign_repo_dir there -- which a review of #7968 measured before it
landed.
Twelve conflicts, all from xcat-core/#7970 landing.
Eleven are the one sed line in the netboot postinstall profiles, where #7970 and
this branch replaced the same line with different patterns. Master's wins: it
anchors on optional leading blanks and preserves a trailing comment, which this
branch's `s/^SELINUX=.*$/SELINUX=disabled/` would have eaten. This branch's own
postinstall_selinux_config.bats asserts "the comment that names permissive keeps
its text", so the better pattern is the one its test already wanted -- 6 of 6
pass on master's version. What master's pattern does not catch is a value
outside enforcing|permissive, which nothing here tests and no stock config
ships.
The twelfth is .github/workflows/xcat_test.yml: master added a step to the
existing job and this branch adds a whole selinux_policy_test job after it.
Resolved as the union, with master's step where it put it; the file still parses
and names three jobs.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Substring and regular-expression matches can mistake a different boot state
or image name for a completed chain. Compare the full state values while
preserving the completed boot exception.
Rejected protocols, unresolved addresses and missing loaders can leave a
partial configuration after removing the previous files. Check these inputs
before replacing the node configuration and its aliases.
An Ubuntu node that netboots legacy Genesis dies with
Failed to execute /init (error -13)
Kernel panic - not syncing: No working init found.
xCAT-genesis-base/debian/rules is a bare `dh $@`, so dh_fixperms applies its
*.so* rule to the whole package. That is right for a Debian shared library and
wrong for a netboot ROOT FILESYSTEM: the kernel execs the payload's dynamic
loader, and a loader with no execute bit makes open_exec() return EACCES, so
every ELF in the image fails to start. mknb copies the tree verbatim into
genesis.fs.<arch>.lzma, so the mode travels into the image. The pipeline's iPXE
command line carries `quiet`, which hid the reason.
Measured on xcat-master-ub from the installed package:
644 .../netboot/genesis/x86_64/fs/usr/lib64/ld-linux-x86-64.so.2
755 .../netboot/genesis/x86_64/fs/usr/bin/basename
and reproduced away from the lab: that management node's own kernel and image
under qemu panicked at 35 seconds, a repack with no change panicked again, and a
repack with only chmod 0755 on the loader reached /init and started dracut.
The EL rpm is unaffected, because it never runs dh_fixperms. This is why only
the Ubuntu genesis-legacy cell saw it, and why that cell has never had a
non-mock green. It is not a regression: the same recipe builds the published
xcat-genesis-base-amd64.
The bit is restored AFTER dh_fixperms rather than excluding the tree with -X,
which would also skip its chown 0:0 pass and ship the payload owned by the build
user.
genesis_deb_loader_executable.t asserts the override exists, still calls
dh_fixperms, is scoped to the netboot tree, names both the glibc and the ppc64le
loader, and runs the chmod AFTER dh_fixperms. Three of its ten assertions fail
without the override, and the ordering assertion fails if the chmod is moved
first -- which is the mistake that looks correct.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The one conflict is the BuildUtils import list: master gained package_skip_reason
with xcat-core/#7978 and this branch adds acquire_lock_dir. Resolved as the union
of the two, keeping the newer POSIX comment -- this branch's abort_builds() is
what needs WNOHANG.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Two conflicts, both from xcat-core/#7978 landing on master.
build-utils/lib/XCAT/BuildUtils.pm: both branches added a package_skip_reason,
#7978 with a general @PACKAGE_SKIPS table and this branch with its own
%EL_ONLY_PACKAGES and a second sub. git merges them as separate hunks because
they sit apart in the file, and Perl takes the LAST definition, so keeping both
silently deletes whichever rule came first. There is now one table and one sub.
A rule names either the target prefixes that do NOT build the package, or, with
`only`, the pattern of the targets that DO. The second form is what an EL-only
package needs: naming the families that are not EL means a family added later
tries to build it, which is how openSUSE reached xCAT-selinux and failed
xcat-core-build-opensuse #42 on a missing selinux-policy-devel.
buildrpms.pl: an empty build plan takes upstream's answer, a clean return rather
than this branch's die. That is the decision #7978 exists for -- the dep
pipeline asks for xCAT-genesis-base alone and no openSUSE target builds it -- so
reinstating the die would fail a build that has nothing to do.
selinux_el_only_scope.t is 37 of 37 and opensuse_no_legacy_genesis.t 22 of 22 on
the merged tree, and the whole unit suite passes: 301 files, 9801 tests.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xcat-core-build-opensuse #42 failed on three packages whose only error was
"No matching package to install: selinux-policy-devel", and took the whole
openSUSE family of xcat-ci #146 down with it. openSUSE Leap ships no
selinux-policy-devel, so the policy module has nothing to compile against.
package_skip_reason in build-utils/lib/XCAT/BuildUtils.pm tested the target
against /\Aopeneuler-/, because openEuler was the one non-EL family buildrpms.pl
targeted when the guard was written. openSUSE was enabled afterwards and matches
no arm of that test, so the EL-only package was selected for it.
The test is now on EL rather than on the families that are not EL, so a family
added later skips an EL-only package instead of trying to build it.
selinux_el_only_scope.t gains the two openSUSE targets. Without this change its
two new assertions fail and the other 35 pass.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Drive the Kea reservation builder and the ISC makedhcp path for grub2
nodes of each architecture. Place the loader links in the site TFTP
directory or in noderes.tftpdir. An aarch64 node with only grub2-<node>
keeps that name. The table stub returns only the requested columns, so
a missing nodetype.arch or noderes.tftpdir read fails the aarch64 cases.
Drive grub2 setstate for the node loader links: both names for an
aarch64 node and one for the others. Cover a repeated nodeset, a node
with only the old link, and removal in the boot, offline and SLES 15
standby states.
Some aarch64 UEFI firmware ignores a DHCP boot file name that does not
end in .efi and requests grubaa64.efi from the TFTP root instead. xCAT
names grub2-<node>, so these nodes stop with a TFTP error before grub2
runs.
For an aarch64 node, nodeset now links grub2-<node>.efi to
grub2.aarch64 beside grub2-<node>. Both DHCP backends name the .efi
link once it exists in the node's TFTP directory (noderes.tftpdir, or
the site one). A node set by an older xCAT keeps grub2-<node> until its
next nodeset, so makedhcp after an upgrade does not name a missing
file. With site.sharedtftp off, every server that runs nodeset for the
node creates both links. This relies on service nodes running the same
xCAT version as the management node, which xCAT requires.
The old link stays for DHCP configurations that makedhcp did not
write. The boot and offline states remove both links. Other
architectures keep grub2-<node>.
Resyncs build-utils/lib/XCAT/NFSLock.pm with xcat-dep, where the defect was
found and fixed.
release deleted the owner metadata and marked the guard released before it
knew the removal could finish. A build lock with a live worker group
therefore lost its metadata when the rmdir failed, and every later build
refused it for ever rather than recovering it when the previous build died.
The sweep had the same ordering and left the same wreck.
Both clear the records of completed workers first and delete the metadata
only once the directory holds nothing else. release retries while a worker
blocks the removal, so cancel_build's retention finishes the release when
the group finally goes.
Depends on xcat-dep/#93, which carries the same change to the original.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The SELinux page carried the repair in two blocks. The first mapped the
published artifacts and ran restorecon over the image root. The second mapped
the publication directory and excluded both guest trees. An operator with
site.installdir=/srv/xcat-install who reads the page in order therefore
relabels before any mapping covers that tree, and rootimg/etc/shadow resolves to
var_t. The exclusion added afterwards keeps the var_t it finds, because it only
stops the next relabel from changing the label again.
The order also cost the artifacts. file_contexts keeps the expressions in the
order they are read and the last one that matches a path wins, so the exclusions
of the second block beat the artifact mappings of the first. Where the image
root carries a rootimg component in the middle, the exclusion matches the
artifacts as well, and the five expressions with a wildcard, the initrds and the
packed images, resolve <<none>>. kernel and hypervisor carry no wildcard and win
either way, which is why the defect showed on a subset.
The page is now one sequence: the publication directory, both guest exclusions,
the artifact mappings, then one restorecon. It says what each step orders and
why.
xCAT-test/native/selinux_image_repair.t passes 381 of 381 checks on this
sequence and fails 47 on the order of the parent commit. selinux_docs.t fails 3
of 30 on the parent commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
selinux_image_repair.t measured a moved publication directory and an image root
with a rootimg component in the middle in separate fixtures, and it called the
mappings of a scenario a repair without running the restorecon the page puts
between them. Neither condition reaches the ordering defect on its own, and the
relabel the procedure runs itself was never measured.
The case now gives each scenario the relabel, so the scenario places it where
the page does. It reads the guest labels straight after the procedure, because a
label the procedure overwrote cannot be recovered by a mapping added afterwards.
It then asserts the mapping and the label of each path after a recursive relabel
and after a reinstall of the module.
A third scenario runs the four documented steps on the layout that needs all of
them: site.installdir is /srv/xcat-images, so no mapping covers the tree until
the procedure adds one, and the image root carries a rootimg component in the
middle, so the guest exclusion matches the published artifacts too.
selinux_docs.t gains three checks on the order of the page: the guest exclusions
come before the artifact mappings, the relabel comes after the last mapping, and
there is one relabel. All three fail against the page at 78f6d65a7.
With the command order of that page, the full sequence fails 47 of 381 checks:
16 guest labels, which go from shadow_t, etc_t and bin_t to var_t, and 15
artifact mappings, which resolve <<none>> for the five expressions that carry a
wildcard.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xcat-dep-build-opensuse15-x86_64 fails its xCAT-genesis-base step. BuildRequires
resolve, and verify-genesis-payload then reports 566 missing zoneinfo/posix paths,
etc/redhat-release, and 45 EL paths and tool names -- net-tools-deprecated,
kmod-compat, iputils, systemd-sysvinit, timezone, nc, mkdosfs and the lvm symlinks.
The manifest is written for EL, so the package cannot be built on openSUSE.
openSUSE ships no legacy Genesis, so it does not need to be. package_skip_reason names
the pairs a target does not build and why, buildrpms.pl prints each skipped pair, and a
plan that skips everything returns 0 rather than failing: the dep pipeline asks for
xCAT-genesis-base alone, so on openSUSE its whole plan is empty and an empty plan is
the plan.
Dropping the package alone would make xCAT unresolvable there.
xCAT-genesis-scripts.spec requires xCAT-genesis-base-%{tarch} unconditionally and xCAT
requires xCAT-genesis-scripts, so zypper install xCAT would fail on a missing package
-- later than the build and looking like something else. That Requires now stands
behind %if ! 0%{?suse_version}; the Leap chroot's /usr/lib/rpm/suse/macros sets
%suse_version 1500, and no EL or openEuler target defines it.
xCAT-test/unit/opensuse_no_legacy_genesis.t covers the skip, the empty plan and the
conditional Requires.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Nothing holds the openSUSE Genesis scope down. xCAT-genesis-base is built for
every target the dep pipeline names, and xCAT-genesis-scripts requires the
payload on every family.
The test reads the build-plan decision and the payload requirement in the spec.
It fails on this commit: the build plan keeps xCAT-genesis-base for openSUSE,
and the requirement carries no condition.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The SELinux page told the operator to run chcon -R -t public_content_t over the
image root to repair a published artifact that kept an older type. That command
walks into rootimg and rootimg-statelite, so it replaces the labels of the guest
operating system with public_content_t. The xcat.fc comment carried the same
advice. chcon also writes a type that no mapping selects, so the next relabel of
a path that has a mapping reverts it: the repair held only until then.
The page now maps each published artifact with semanage fcontext and applies the
mapping with restorecon. Each expression names one regular file directly below
the image root, so no path in either guest tree matches one, and both trees keep
the <<none>> of the packaged mappings. The procedure reads the publication
directory from site.installdir, and a site that moved it maps the configured
directory and keeps both guest trees out of that mapping. The page says why a
tree mapping over the image root is the same defect as the chcon.
xCAT-test/native/selinux_image_repair.t passes 170 of 170 checks with the
documented procedure. With the chcon of the previous page it fails 101, 36 of
them guest labels. selinux_docs.t fails 7 of 26 on the parent commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
The SELinux page documents a recursive chcon to repair a published artifact
that carries the wrong type. No case runs that procedure, so nothing measures
what it does to the guest trees of the image root, and nothing measures whether
the repair survives a later relabel.
selinux_image_repair.t starts with default_t on every published artifact of an
image root and with valid types in both rootimg and rootimg-statelite. It runs
the repair, then reads the labels back after a recursive relabel and after a
reinstall of the module. It covers the standard publication directory and one
that site.installdir moved, because the packaged mappings name /install.
semanage writes to the policy store of the host, so the case refuses to run
where SELinux is enabled and removes every mapping it adds. restorecon is a
no-op where SELinux is disabled, so the case applies the mappings with setfiles
and asserts that the merged file_contexts answers what the store answers for
each path.
selinux_docs.t gains the checks that keep the page and the xcat.fc comment from
describing a chcon repair. 7 of its 26 checks fail on this commit.
With the chcon of the page in place of the documented procedure,
selinux_image_repair.t fails 101 of its 170 checks, 36 of them guest labels that
the recursive chcon overwrote.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Execute the complete postscript and check the daemon UID before real UDP
log delivery. Cover fresh and repeated MN/SN setup, restricted directories,
legacy ownership and modes, and a blocked directory path. Keep the upgrade
wrapper and forwarding cases as compatibility controls.
Select older configuration branches through their version-report boundary;
use the installed daemon, without claiming old-daemon qualification.
Run the isolated native cases in CI.
Create missing Debian-family log directories before assigning their owner.
Use mode 0750 for syslog-owned directories. In the legacy reference-owner
path, copy the parent directory mode so group-writing daemons retain access.
Preserve existing directory modes, log files and forwarding policy.
Stop with an error before restarting syslog if the directory cannot be
created. Keep existing ownership-command failures nonfatal.
Run routeop against real kernel routes. Cover repeated add, replacement,
deletion, another device, expanded addresses and failure preservation.
Check SLES, legacy Red Hat and Debian persistent records, including
unscoped records and neighboring interface names. Keep global-gateway
and connected-route controls.
Scope generic Linux route lookup and updates to the supplied interface for
link-local next hops. Retain the device in SLES routes, legacy Red Hat
route6 records and Debian interface commands. Remove matching saved
records without matching neighboring interface names, and migrate older
unscoped records when adding routes.
Keep global gateways, connected routes and NetworkManager policy unchanged.
BuildUtils::sh() runs each build command in its own process group, so
SIGKILL on the wrapper leaves that group running. The lock records the
wrapper, so the next build proved the wrapper dead and took the lock, and
two builds then wrote one checkout and one mock target. cancel_build keeps
the lock on purpose when a group survives its cleanup, and that recovery
undid the retention.
sh() now records the group on every lock this process holds, before it
restores the signal mask, so a cancellation cannot land between the fork
and the record. It drops the record after the group is reaped.
cancel_build drops it only when kill(0, -pgid) answers ESRCH, which is the
test it already used to decide it may release; on the retention path the
record stays, and a later acquire reads it and refuses the lock.
The vendored XCAT::NFSLock carries the rule: an owner is recoverable only
when it is provably dead and every attached group is gone. detach refuses
while any process is in the group, so the retention does not depend on
which call site remembered to run.
Depends on xcat-dep/#93, which carries the same change to the original.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
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>
Resyncs build-utils/lib/XCAT/NFSLock.pm with xcat-dep, where the defect was
found and fixed. The module reclaimed a stranded lock.borrow by path after
validating its metadata, and rmdir names a path and not the inode that was
validated, so a contender stopped between the two steps removed whatever
was at the path when it resumed. Two builds of one target could then both
hold the build lock, which is the collision the lock exists to prevent.
The borrow is numbered now, and a transition whose taker is provably dead
is ended by creating the next generation rather than by removing the one
that was validated. A process removes only a generation it created and
still holds.
acquire_lock_dir's comment said the retry budget covers reclaiming a borrow
with no metadata over two attempts. That rule is withdrawn, because a live
taker can pause for any length of time before its first write. A take-over
needs one attempt; the budget leaves two for a contended lock.
Depends on xcat-dep/#93, which carries the same change to the original.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
xCAT-selinux is in the default package set of buildrpms.pl, so every target
builds it. openEuler 20.03sp4 and 22.03sp4 carry selinux-policy 3.14.2, which
defines none of unconfined_server_stream_connectto(), files_map_etc_files() or
chronyd_manage_pid_files(). m4 leaves an undefined interface name in its
output and checkmodule stops with a syntax error, so rpmbuild fails and the
core build for that target publishes no repository at all.
SELinux support is EL only. XCAT::BuildUtils::package_skip_reason names the
packages an openEuler target does not build, and buildrpms.pl prints each pair
it skips. openEuler 24.03sp4 carries selinux-policy 40.7 and does compile the
module. It is excluded as well, so no openEuler release ships a package the
other releases cannot build.
xCAT-server and xCATsn required xCAT-selinux when selinux-policy-targeted was
installed, on openEuler too. openEuler defines %openEuler and no %rhel, so the
condition now names EL 8 and later and Fedora only. Without this an openEuler
management node cannot resolve xCAT-server.
xCAT-test/unit/selinux_el_only_scope.t fails on the parent commit.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
Nothing holds the scope of xCAT-selinux down. The package is in the default
set of buildrpms.pl, so every target builds it, and xCAT-server and xCATsn
require it on openEuler as well as on EL.
The test reads the build-plan decision and the two spec conditions. It fails
on this commit: BuildUtils has no build-plan decision, and both conditions
still name openEuler.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
builddebs.pl describes the regression it fixed by quoting "another build
already holds". acquire_lock_dir prints "another build still holds" now,
and only when the retry budget ran out, so the quoted text names nothing a
reader can find.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>
acquire_lock_dir dies with "another build of <what> already holds
<lockdir>" whenever XCAT::NFSLock->acquire fails, whatever the failure was.
A lockdir under a directory that does not exist, or one the build cannot
write, both tell the operator to look for a build that is not running, and
both print the advice about --mock-uniqueext. The nested text said "Trying
to unlock", which is the reverse of what acquire was doing.
acquire_lock_dir now reports contention only when the retry budget ran out,
and prints the error that happened otherwise. The vendored
XCAT::NFSLock is resynced with xcat-dep: its refusal names which failure it
was, and it reclaims a lock.borrow that has no metadata and that two
attempts find unchanged, which was a permanent strand. A lock.d with no
metadata stays refused, so a directory left by a build from before this
change is not recovered by acquire; sweep_stranded removes that one, and
only under an exclusive claim on the root.
buildrpms.pl kept "use POSIX (); # EEXIST, for the directory build lock",
and the lock has not used EEXIST since it became an XCAT::NFSLock. The
import is still needed for WNOHANG in abort_builds.
Depends on xcat-dep/#93, which carries the same change to the original
copy of XCAT/NFSLock.pm.
Signed-off-by: Daniel Hilst <392820+dhilst@users.noreply.github.com>