[parted-devel] [PATCH] arch: Fix race between systemd and parted command

Brian C. Lane bcl at redhat.com
Mon Oct 7 21:06:54 BST 2024


On Thu, Sep 26, 2024 at 08:33:59PM +0000, Gulam Mohamed wrote:
> When parted commands like print, delete and others along with create
> command, are run continuously, at some point of time a race has been
> noticed between the create command and systemd.

Thanks for the patch. There has been a longstanding problem with races
between parted and udev and the general solution is to make sure the
device exists before you continue with the next step in your loop. You
can't just sit in a loop and expect it to work.

We've solved this in the tests by waiting for the expected device node
to appear before continuing the tests, and this works pretty well.

But, maybe it is time to implement some retries like this. A couple
thoughts on that:

- how many and how much delay? I think there's going to be situations
  where things may still fail. But you also don't want really long
  delays if there really is a missing device.
- It should be implemented for everything that udev touches. Right now
  this patch only changes one function.
- Can we reliable test for this so we can add a test? In my experience,
  I'd say maybe :)
- I'd also set the retry counter and delay as defines, not calculated
  variables (although the compiler ought to optimize those).

Thanks,

Brian

-- 
Brian C. Lane (PST8PDT) - weldr.io - lorax - parted - pykickstart




More information about the parted-devel mailing list