lvm: try and workaround an umount -> lvremove udev timing bug with a time.sleep(1)
authorTero Marttila <terom@paivola.fi>
Fri, 02 Mar 2012 15:40:21 +0200
changeset 29 5abd153d78eb
parent 28 82bcde9e21c4
child 30 29b60df79122
lvm: try and workaround an umount -> lvremove udev timing bug with a time.sleep(1)
pvl/backup/lvm.py
--- a/pvl/backup/lvm.py	Fri Mar 02 15:39:50 2012 +0200
+++ b/pvl/backup/lvm.py	Fri Mar 02 15:40:21 2012 +0200
@@ -77,8 +77,15 @@
             yield snapshot
 
         finally:
+            # XXX: there's some timing bug with an umount leaving the LV open, do we need to wait for it to get closed after mount?
+            #       https://bugzilla.redhat.com/show_bug.cgi?id=577798
+            #       some udev event bug, possibly fixed in lvm2 2.02.86?
+            # try to just patiently wait for it to settle down... if this isn't enough, we need some dmremove magic
+            log.debug("cleanup: waiting for snapshot volume to settle...")
+            import time
+            time.sleep(1)
+
             # cleanup
-            # XXX: there's some timing bug with an umount leaving the LV open, do we need to wait for it to get closed after mount?
             log.debug("cleanup: {0}".format(snapshot))
             snapshot.close()