Change in vdsm[ovirt-3.5]: storageServer: Wait for udev events after connect

ahino at redhat.com ahino at redhat.com
Tue Apr 7 13:38:24 UTC 2015


Hello Douglas Schilling Landgraf, Nir Soffer, Dan Kenigsberg, Allon Mureinik,

I'd like you to do a code review.  Please visit

    https://gerrit.ovirt.org/39607

to review the following change.

Change subject: storageServer: Wait for udev events after connect
......................................................................

storageServer: Wait for udev events after connect

Connecting to iSCSI target starts a storm of udev events, that may not
be handled yet when iscsiadm terminates. This may lead to missing
devices and failures when creating storage domain.

Now we wait until current udev events are handled after connecting,
using new udevadm.settle(). The timeout can be configured using the
new irs:scsi_settle_timeout option.

Change-Id: Ic8b2043dc4ac410cf08c7b49b6435a818f20d995
Bug-Url: https://bugzilla.redhat.com/1205877
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
Reviewed-on: https://gerrit.ovirt.org/39289
Reviewed-by: Douglas Schilling Landgraf <dougsland at redhat.com>
Tested-by: Douglas Schilling Landgraf <dougsland at redhat.com>
Reviewed-by: Allon Mureinik <amureini at redhat.com>
Reviewed-by: Dan Kenigsberg <danken at redhat.com>
---
M vdsm/storage/storageServer.py
1 file changed, 4 insertions(+), 0 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/07/39607/1

diff --git a/vdsm/storage/storageServer.py b/vdsm/storage/storageServer.py
index 76c043c..99cebb2 100644
--- a/vdsm/storage/storageServer.py
+++ b/vdsm/storage/storageServer.py
@@ -30,6 +30,7 @@
 from functools import partial
 
 from vdsm.compat import pickle
+from vdsm.config import config
 
 import mount
 import fileUtils
@@ -38,6 +39,7 @@
 from sync import asyncmethod, AsyncCallStub
 from mount import MountError
 import storage_exception as se
+import udevadm
 
 
 class AliasAlreadyRegisteredError(RuntimeError):
@@ -365,6 +367,8 @@
 
     def connect(self):
         iscsi.addIscsiNode(self._iface, self._target, self._cred)
+        timeout = config.getint("irs", "scsi_settle_timeout")
+        udevadm.settle(timeout)
 
     def isSession(self, session):
         target = session.target


-- 
To view, visit https://gerrit.ovirt.org/39607
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ic8b2043dc4ac410cf08c7b49b6435a818f20d995
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: ovirt-3.5
Gerrit-Owner: Ala Hino <ahino at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Dan Kenigsberg <danken at redhat.com>
Gerrit-Reviewer: Douglas Schilling Landgraf <dougsland at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>


More information about the vdsm-patches mailing list