Federico Simoncelli has posted comments on this change.

Change subject: BZ#844180: Change scsi scan to asynchronous
......................................................................


Patch Set 9: I would prefer that you didn't submit this

(4 inline comments)

Few comments.

....................................................
File vdsm/storage/iscsi.py
Line 354:     processes = []
Line 355:     minTimeout = config.getint('irs', 'scsi_rescan_minimal_timeout')
Line 356:     maxTimeout = config.getint('irs', 'scsi_rescan_maximal_timeout')
Line 357:     for hba in glob.glob(SCAN_PATTERN):
Line 358:         cmd = ['echo', '- - -', '|', '/usr/bin/sudo -n','/bin/dd 
of=', hba]
I'd go for a more man-alike cmd as:

 cmd = [/bin/dd', "of=" + hba]

That said I think that we shouldn't be using sudo and dd at all.
Line 359:         processes.append((hba, misc.execCmd(cmd, sudo=False, 
sync=False)))
Line 360:     if (minTimeout > maxTimeout or minTimeout < 0):
Line 361:         minTimeout = 2
Line 362:         maxTimeout = 30


Line 365:                     "scsi_rescan_maximal_timeout. Set to %s and %s 
seconds ",
Line 366:                     "respectively.", minTimeout, maxTimeout)
Line 367:     log.debug("Performing SCSI scan, this will take up to %s seconds",
Line 368:                 maxTimeout)
Line 369:     time.sleep(minTimeout)
What's the benefit of having a minTimeout? (It's like saying that you never 
want to be faster than that).
Line 370:     for i in xrange(maxTimeout - minTimeout):
Line 371:         for p in processes[:]:
Line 372:             if p[1].wait(0):
Line 373:                 if p[1].returncode != 0:


Line 367:     log.debug("Performing SCSI scan, this will take up to %s seconds",
Line 368:                 maxTimeout)
Line 369:     time.sleep(minTimeout)
Line 370:     for i in xrange(maxTimeout - minTimeout):
Line 371:         for p in processes[:]:
Few people will have the time and will to understand what's actually going on 
with this line and lines 376-377 :-) The whole thing looks a little convoluted 
to me but I won't NACK it in the end (since I'm not proposing an alternative 
yet).
Line 372:             if p[1].wait(0):
Line 373:                 if p[1].returncode != 0:
Line 374:                     log.warning('returncode for: %s is: %s', p[0],
Line 375:                                 p[1].returncode)


Line 368:                 maxTimeout)
Line 369:     time.sleep(minTimeout)
Line 370:     for i in xrange(maxTimeout - minTimeout):
Line 371:         for p in processes[:]:
Line 372:             if p[1].wait(0):
We could try to use a timeout (> 0) so that we are more responsive with the 
maxTimeout deadline (eg: we could get stuck here for a long time).
Line 373:                 if p[1].returncode != 0:
Line 374:                     log.warning('returncode for: %s is: %s', p[0],
Line 375:                                 p[1].returncode)
Line 376:                 processes.remove(p)


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

Gerrit-MessageType: comment
Gerrit-Change-Id: I7665ebaed716f75af4d03ec1b6a9ff9ff5d84853
Gerrit-PatchSet: 9
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Yeela Kaplan <[email protected]>
Gerrit-Reviewer: Ayal Baron <[email protected]>
Gerrit-Reviewer: Daniel Erez <[email protected]>
Gerrit-Reviewer: Daniel Paikov <[email protected]>
Gerrit-Reviewer: Eduardo <[email protected]>
Gerrit-Reviewer: Federico Simoncelli <[email protected]>
Gerrit-Reviewer: Haim Ateya <[email protected]>
Gerrit-Reviewer: Igor Lvovsky <[email protected]>
Gerrit-Reviewer: Yeela Kaplan <[email protected]>
Gerrit-Reviewer: oVirt Jenkins CI Server
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to