Race condition in handling of udev generated symlinks

Bug #1161557 reported by Joseph Glanville
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Invalid
Low
Unassigned
OpenStack Compute (nova)
Opinion
Low
Unassigned

Bug Description

In several components in both Cinder and Nova udev provided symlinks are expected to appear immediately.
This is not the case as udev rules run async of device plugging.
Volume drivers in Cinder and the libvirt driver in Nova seem to be the primary culprits.

To solve this we should wait for udevd to finish processing events, this can be done with udevadm by calling settle. This is done by simply calling "udevadm settle". Additionally it can be called with a timeout (probably a good idea).
Excerpt from udevadm settle --help:

Usage: udevadm settle OPTIONS
  --timeout=<seconds> maximum time to wait for events
  --seq-start=<seqnum> first seqnum to wait for
  --seq-end=<seqnum> last seqnum to wait for
  --exit-if-exists=<file> stop waiting if file exists
  --quiet do not print list after timeout
  --help

For more intelligent use we could wrap this in a function that can use the --exit-if-exists behavior.

This will ensure the symlink actually exists before we try use it.

description: updated
Revision history for this message
Vish Ishaya (vishvananda) wrote :

good suggestion. This might allow us to remove some of the retrys that we use.

Changed in nova:
importance: Undecided → Low
status: New → Triaged
Changed in cinder:
status: New → Triaged
importance: Undecided → Low
milestone: none → havana-1
David Medberry (med)
Changed in cinder:
assignee: nobody → David Medberry (med)
Changed in nova:
assignee: nobody → David Medberry (med)
Thierry Carrez (ttx)
Changed in cinder:
milestone: havana-1 → havana-2
Changed in cinder:
milestone: havana-2 → havana-3
Revision history for this message
John Griffith (john-griffith) wrote :

We should investigate this a bit more, I did a little looking (because I'm worried that this isn't making any progress) and it seems that there were some very good reasons why udev settle was disabled for LVM a while back. There appears to be some significant issues around race-conditions caused by udev-settle, though to be quite honest I don't fully understand all of these things yet.

I should also add sheepishly, I'm not even sure what versions of Ubuntu for example no longer pull this in by default, it seems that RedHat still does (again, I could be wrong, but first glance that appears to be the case).

_med: any info on this based on the work you've been looking in to so far?

Revision history for this message
David Medberry (med) wrote :

john-griffith: No, no update.

Changed in cinder:
assignee: David Medberry (med) → nobody
milestone: havana-3 → none
David Medberry (med)
Changed in nova:
assignee: David Medberry (med) → nobody
Revision history for this message
Sean Dague (sdague) wrote :

This is unclear that it's a real bug, as it was disabled in the past. Definitely not in a triaged state.

Changed in nova:
status: Triaged → Opinion
Changed in cinder:
status: Triaged → Incomplete
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.