Change in vdsm[master]: stomp: make sure to handle eagain

piotr.kliczewski at gmail.com piotr.kliczewski at gmail.com
Wed May 4 08:07:52 UTC 2016


Piotr Kliczewski has uploaded a new change for review.

Change subject: stomp: make sure to handle eagain
......................................................................

stomp: make sure to handle eagain

Checking asyncore documentation I noticed that we do not process recv
properly. I found that:

Note that recv() may raise socket.error with EAGAIN or EWOULDBLOCK

betterAsyncore code was based on asyncore.dispatcher so the issue was
duplicated. We need to make sure to handle this error propely.


Change-Id: I7fcd96522f007dd7159c555080821c3e3f8abf1a
Signed-off-by: pkliczewski <piotr.kliczewski at gmail.com>
Bug-Url: https://bugzilla.redhat.com/1321325
Related-To: https://bugs.python.org/issue16133
---
M lib/yajsonrpc/betterAsyncore.py
1 file changed, 2 insertions(+), 2 deletions(-)


  git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/97/56997/1

diff --git a/lib/yajsonrpc/betterAsyncore.py b/lib/yajsonrpc/betterAsyncore.py
index 8ef9431..ae70824 100644
--- a/lib/yajsonrpc/betterAsyncore.py
+++ b/lib/yajsonrpc/betterAsyncore.py
@@ -20,7 +20,7 @@
 import asyncore
 import logging
 import socket
-from errno import EWOULDBLOCK
+from errno import EWOULDBLOCK, EAGAIN
 
 from vdsm.sslcompat import sslutils
 from vdsm.infra.eventfd import EventFD
@@ -96,7 +96,7 @@
                 return data
         except socket.error as why:
             # winsock sometimes raises ENOTCONN
-            if why.args[0] == EWOULDBLOCK:
+            if why.args[0] in (EWOULDBLOCK, EAGAIN):
                 return None
             elif why.args[0] in asyncore._DISCONNECTED:
                 self.handle_close()


-- 
To view, visit https://gerrit.ovirt.org/56997
To unsubscribe, visit https://gerrit.ovirt.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7fcd96522f007dd7159c555080821c3e3f8abf1a
Gerrit-PatchSet: 1
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Piotr Kliczewski <piotr.kliczewski at gmail.com>


More information about the vdsm-patches mailing list