Repository navigation
Fix races with udev - #446
Merged
Merged
Conversation
ajeddeloh
force-pushed
the
fix-races
branch
from
September 13, 2017 18:39
bc739f7 to
d56a291
Compare
Contributor
Author
|
/cc @bgilbert |
ajeddeloh
force-pushed
the
fix-races
branch
2 times, most recently
from
September 13, 2017 20:46
504788f to
c892950
Compare
Contributor
Author
|
Did testing with |
ajeddeloh
force-pushed
the
fix-races
branch
from
September 14, 2017 17:26
c892950 to
ef01c64
Compare
added 2 commits
September 14, 2017 10:52
CreateDeviceAlias exists to create a stable symlink to be used so when udev deletes and recreates the symlink it owns, Ignition wont fail. However there is a narrow race creating the symlink: if udev creates then deletes its symlink fast enough we wont have time to read the symlink to create our own. This adds retry logic to rapidly retry creating the symlink, in case we lose the race, but still fail after a timeout.
Previously we only did a udevadm settle after creating filesystems; this was added because creating btrfs filesystems was particularly good at causing these races. Usually only settling after creating filesystems is ok, because we typically create filesystems after partitioning. But partitioning can create these kinds of races too, and if we do not create filesystems we never settle and units dependent on Ignition and a /dev symlink could find their link deleted out from under them. This moves the settle up to happen after dealing with the disks stage in entirety. It could be added as an ExecStartPost directive in the unit file, but here we can be smart and skip it if the disks stage didn't do anything.
ajeddeloh
force-pushed
the
fix-races
branch
from
September 14, 2017 17:52
ef01c64 to
ce56ae8
Compare
Contributor
Author
|
Moved retry logic to more tightly wrap EvaluateSymlink and made it retry more aggressively. |
crawford
approved these changes
Sep 14, 2017
bgilbert
approved these changes
Sep 14, 2017
prestist
added a commit
to prestist/ignition
that referenced
this pull request
Jan 12, 2026
docs/release-notes: update for release
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses two races:
/dev/*symlinks and Ignition. Runningudevadm settlegreatly reduces the size of the race. This PR ensures we always settle if we mess with disks, even if we do not create filesystems.