Nir Soffer has posted comments on this change. Change subject: introducing downloadFromStream verb ......................................................................
Patch Set 4: (3 comments) http://gerrit.ovirt.org/#/c/23281/4//COMMIT_MSG Commit Message: Line 7: introducing downloadFromStream verb Line 8: Line 9: This patch introduces the downloadFromStream verb in vdsm which Line 10: allows to upload using streaming content to vdsm images. Line 11: XML-RPC spec doesn't support streaming, as we don't want to use HTTP > It's not related to XML-RPC payload limit, it relates that we want to strea We are sending the whole payload in the request, just like xml rpc. The difference is that xmlrpc payload is limited in size, but sending data using bare http is not. Line 12: server in addition to the current XML-RPC server (to not use another Line 13: port) we will threat some requests as http requests instead of xml-rpc Line 14: requests. Line 15: http://gerrit.ovirt.org/#/c/23281/4/vdsm/storage/imageSharing.py File vdsm/storage/imageSharing.py: Line 28: Line 29: Line 30: log = logging.getLogger("Storage.ImageSharing") Line 31: WAIT_TIMEOUT = 30 Line 32: BUFFER_READ_SIZE = 65536 > I don't really agree - we never use it for writing, just for reading. the s What we read from the socket, we write to the pipe, don't we? Line 33: Line 34: Line 35: def httpGetSize(methodArgs): Line 36: headers = curlImgWrap.head(methodArgs.get('url'), Line 90: total_size - bytes_left, total_size) Line 91: raise se.MiscFileReadException() Line 92: Line 93: p.stdin.write(data) Line 94: p.stdin.flush() > what comment would you suggest? This: Process stdin is not a real file object but a wrapper using StringIO buffer. To ensure that we don't use more memory if we get data faster then dd read it from the pipe, we flush on every write. We can remove if we can limit the buffer size used by this stdin wrapper. Line 95: bytes_left = bytes_left - len(data) Line 96: Line 97: p.stdin.close() Line 98: if not p.wait(WAIT_TIMEOUT): -- To view, visit http://gerrit.ovirt.org/23281 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: comment Gerrit-Change-Id: I768b84799ed9fb2769c6d4240519d036f8988b99 Gerrit-PatchSet: 4 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Liron Ar <[email protected]> Gerrit-Reviewer: Ayal Baron <[email protected]> Gerrit-Reviewer: Federico Simoncelli <[email protected]> Gerrit-Reviewer: Liron Ar <[email protected]> Gerrit-Reviewer: Nir Soffer <[email protected]> Gerrit-Reviewer: Sergey Gotliv <[email protected]> Gerrit-Reviewer: Tal Nisan <[email protected]> Gerrit-Reviewer: oVirt Jenkins CI Server Gerrit-HasComments: Yes _______________________________________________ vdsm-patches mailing list [email protected] https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches
