Skip to content

Wait for resource files#51

Merged
ericonr merged 2 commits intomasterfrom
wait-for-resource
Feb 10, 2026
Merged

Wait for resource files#51
ericonr merged 2 commits intomasterfrom
wait-for-resource

Conversation

@ericonr
Copy link
Member

@ericonr ericonr commented Feb 4, 2026

No description provided.

This commit is preparation for adding more logic to the existing actions
in the udev rule. There's no need to create a separate script, we can
simply fold everything into the ioc-start.sh script.
Copy link
Contributor

@henriquesimoes henriquesimoes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. As I mentioned in person, it would be nice to have the (yet-to-be-sent) e-mail reporting this kernel bug upstream linked here for future reference if possible.

Startup issues were observed when running these IOCs on certain CPUs
(e.g. the Intel Xeon E-2276ML CPUs we recently acquired as spare parts).
Despite the udev rule being triggered, some/all of the resource files
hadn't been created yet when the chmod command was run. Therefore, the
correct permissions weren't applied to the resource files, so the IOC
running as the iocs user couldn't open them. When none of the files were
available, it would lead to a bad glob expansion as an additional error.

This issue hasn't been observed on the Intel Xeon E3-1505L CPUs we are
currently using in production, even though both platforms are running
the same distribution (Debian 12) and using the same kernel version
(6.1.99). It also happens on kernel 6.12.57.

This commit fixes these issues by waiting for all the resource files
before running chmod. udev itself used to support similar functionality,
but it was removed because such delays are kernel bugs which they don't
want to paper over [1]. We have also reported the bug [2].

We check for all known resource files, including resource2_wc, even
though the underlying uhal library also supports non-write-combining
BAR2, because we want to be sure we are launching the IOCs in a
consistent environment. And, since we now have a list of all needed
resource files, we can simply pass that list to chmod, instead of using
a glob.

In order to avoid an eternal loop, we wait for up to 1s (in 10 0.1s
increments) for the files to be available. Testing shows the files take
around 0.07s to be available.

[1] systemd/systemd@f2b8052
[2] https://bugzilla.kernel.org/show_bug.cgi?id=221049
@ericonr ericonr merged commit 1b8c02d into master Feb 10, 2026
2 checks passed
@ericonr ericonr deleted the wait-for-resource branch February 10, 2026 20:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants