Change in vdsm[master]: avoid waiting for event forever
nsoffer at redhat.com
nsoffer at redhat.com
Thu May 22 11:00:11 UTC 2014
Nir Soffer has posted comments on this change.
Change subject: avoid waiting for event forever
......................................................................
Patch Set 6: Code-Review-1
(1 comment)
Good catch, but error handling should be simplified.
http://gerrit.ovirt.org/#/c/27977/6/vdsm/BindingXMLRPC.py
File vdsm/BindingXMLRPC.py:
Line 165: 'contentLength': contentLength}
Line 166: image = API.Image(imgUUID, spUUID, sdUUID)
Line 167: response = image.downloadFromStream(methodArgs,
Line 168: upload_finished,
Line 169: volUUID)
First check for errors and fail fast:
if response['status']['code'] != 0:
send error and return
# Continue the normal flow
The way you handle the failure make it more complicated for no reason. and make the patch bigger and less clear.
Line 170: if response['status']['code'] == 0:
Line 171: while not uploadFinishedEvent.is_set():
Line 172: uploadFinishedEvent.wait()
Line 173: self.send_response(httplib.OK)
--
To view, visit http://gerrit.ovirt.org/27977
To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I04fdd4e6babad93ba69c2ac377f5489c5be21584
Gerrit-PatchSet: 6
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Liron Ar <laravot at redhat.com>
Gerrit-Reviewer: Allon Mureinik <amureini at redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce at redhat.com>
Gerrit-Reviewer: Nir Soffer <nsoffer at redhat.com>
Gerrit-Reviewer: Tal Nisan <tnisan at redhat.com>
Gerrit-Reviewer: automation at ovirt.org
Gerrit-Reviewer: oVirt Jenkins CI Server
Gerrit-HasComments: Yes
More information about the vdsm-patches
mailing list