Change in vdsm[master]: Revert "hba: Run fc-scan in supervdsm"

nsoffer at redhat.com nsoffer at redhat.com
Sun Jan 25 12:41:28 UTC 2015


Nir Soffer has uploaded a new change for review.

Change subject: Revert "hba: Run fc-scan in supervdsm"
......................................................................

Revert "hba: Run fc-scan in supervdsm"

In commit 0636b8607b (Revert "supervdsm: Add zombiereaper to supervdsm")
We removed zombiereaper from supervdsm, but hba._scan(), called from
supervdsm was depending on zombiereaper reaping stuck fc-scan processes.
This cause stuck fc-scan Python processes to run as zombie for the whole
lifetime of the supervdsm processs.

This revert back to running fc-scan using sudo from vdsm. We can
reintrocude the reverted patch when we have a working zombiereaper in
supervdsm.

This reverts commit 5a6ae1a266e6808861a10933d7cacb81838050f1.

Change-Id: Ica493bd2e269ae3fcee2e2ec91df5aa5e323a23f
Signed-off-by: Nir Soffer <nsoffer at redhat.com>
---
M vdsm/storage/hba.py
M vdsm/sudoers.vdsm.in
M vdsm/supervdsmServer
3 files changed, 7 insertions(+), 26 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/61/37261/1

diff --git a/vdsm/storage/hba.py b/vdsm/storage/hba.py
index efd0273..0d4e688 100644
--- a/vdsm/storage/hba.py
+++ b/vdsm/storage/hba.py
@@ -31,7 +31,6 @@
 from vdsm.infra import zombiereaper
 
 import misc
-import supervdsm
 
 log = logging.getLogger("Storage.HBA")
 
@@ -44,41 +43,27 @@
 NODE_NAME = "node_name"
 
 
-class Error(Exception):
-    """ hba operation failed """
-
-
 @misc.samplingmethod
 def rescan():
     """
     Rescan HBAs discovering new devices.
     """
-    log.debug("Starting scan")
-    try:
-        supervdsm.getProxy().hbaRescan()
-    except Error as e:
-        log.error("Scan failed: %s", e)
-    else:
-        log.debug("Scan finished")
-
-
-def _rescan():
-    """
-    Called from supervdsm to perform rescan as root.
-    """
     timeout = config.getint('irs', 'scsi_rescan_maximal_timeout')
 
-    proc = utils.execCmd([constants.EXT_FC_SCAN], sync=False,
+    log.debug("Starting scan")
+    proc = utils.execCmd([constants.EXT_FC_SCAN], sync=False, sudo=True,
                          execCmdLogger=log)
     try:
         proc.wait(timeout)
     finally:
         if proc.returncode is None:
+            log.warning("Timeout scanning")
             zombiereaper.autoReapPID(proc.pid)
-            raise Error("Timeout scanning (pid=%s)" % proc.pid)
         elif proc.returncode != 0:
             stderr = proc.stderr.read(512)
-            raise Error("Scan failed: %r" % stderr)
+            log.error("Scan failed: %r", stderr)
+        else:
+            log.debug("Scan finished")
 
 
 def getiSCSIInitiators():
diff --git a/vdsm/sudoers.vdsm.in b/vdsm/sudoers.vdsm.in
index da88ff2..0572866 100644
--- a/vdsm/sudoers.vdsm.in
+++ b/vdsm/sudoers.vdsm.in
@@ -15,6 +15,7 @@
     @BINDIR@/vdsm-tool service-restart multipathd, \
     @BINDIR@/vdsm-tool service-reload multipathd, \
     @ISCSIADM_PATH@ *, \
+    @LIBEXECDIR@/fc-scan, \
     @LVM_PATH@, \
     @CAT_PATH@ /sys/block/*/device/../../*, \
     @CAT_PATH@ /sys/devices/platform/host*, \
diff --git a/vdsm/supervdsmServer b/vdsm/supervdsmServer
index 7a984e4..1c10c81 100755
--- a/vdsm/supervdsmServer
+++ b/vdsm/supervdsmServer
@@ -65,7 +65,6 @@
 from storage.iscsi import getDevIscsiInfo as _getdeviSCSIinfo
 from storage.iscsi import readSessionInfo as _readSessionInfo
 from supervdsm import _SuperVdsmManager
-from storage import hba
 from storage.fileUtils import chown, resolveGid, resolveUid
 from storage.fileUtils import validateAccess as _validateAccess
 from vdsm.constants import METADATA_GROUP, EXT_CHOWN, EXT_UDEVADM, \
@@ -347,10 +346,6 @@
     @logDecorator
     def fuser(self, *args, **kwargs):
         return fuser.fuser(*args, **kwargs)
-
-    @logDecorator
-    def hbaRescan(self):
-        return hba._rescan()
 
     @logDecorator
     def set_rp_filter_loose(self, dev):


-- 
To view, visit http://gerrit.ovirt.org/37261
To unsubscribe, visit http://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ica493bd2e269ae3fcee2e2ec91df5aa5e323a23f
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Nir Soffer <nsoffer at redhat.com>


More information about the vdsm-patches mailing list