Shu Ming has uploaded a new change for review.

Change subject: No need to call receive if send is timeout
......................................................................

No need to call receive if send is timeout

In callCrabRPCFunction(), the request packet is sent to the crab server first
and then wait for the response packet from the crab server.  When the
request packet is not sent correctly, there is no need to wait for the response
packet back.  So raising exception after the send operation is timeout.

Change-Id: Ib233b24d108a986d2f9e07a66f2a8f7d8cfb221a
Signed-off-by: Shu Ming <[email protected]>
---
M vdsm/storage/remoteFileHandler.py
1 file changed, 8 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/59/7759/1

diff --git a/vdsm/storage/remoteFileHandler.py 
b/vdsm/storage/remoteFileHandler.py
index 622ea5d..6995c39 100644
--- a/vdsm/storage/remoteFileHandler.py
+++ b/vdsm/storage/remoteFileHandler.py
@@ -173,8 +173,13 @@
 
     def callCrabRPCFunction(self, timeout, name, *args, **kwargs):
         request = pickle.dumps((name, args, kwargs))
-        self._sendAll(pack(LENGTH_STRUCT_FMT, len(request)), timeout)
-        self._sendAll(request, timeout)
+        try:
+            self._sendAll(pack(LENGTH_STRUCT_FMT, len(request)), timeout)
+            self._sendAll(request, timeout)
+        except:
+            self.log.warn("Problem with handler send, treating as timeout",
+                    exc_info=True)
+            raise Timeout()
 
         try:
             rawLength = self._recvAll(LENGTH_STRUCT_LENGTH, timeout)
@@ -184,7 +189,7 @@
         except:
             # If for some reason the connection drops\gets out of sync we treat
             # it as a timeout so we only have one error path
-            self.log.warn("Problem with handler, treating as timeout",
+            self.log.warn("Problem with handler receive, treating as timeout",
                     exc_info=True)
             raise Timeout()
 


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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Ib233b24d108a986d2f9e07a66f2a8f7d8cfb221a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Shu Ming <[email protected]>
_______________________________________________
vdsm-patches mailing list
[email protected]
https://lists.fedorahosted.org/mailman/listinfo/vdsm-patches

Reply via email to