[NEW PATCH] BZ#732245, BZ#732269 - Handle EAGAIN and EINTR in AsyncProc.communicate (via gerrit-bot)
Saggi Mizrahi
smizrahi at redhat.com
Thu Sep 1 08:32:07 UTC 2011
New patch submitted by Saggi Mizrahi (smizrahi at redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/865
commit 0d717c9ca6b089108273352b392697f969e0e69a
Author: Saggi Mizrahi <smizrahi at redhat.com>
Date: Tue Aug 30 11:14:25 2011 +0300
BZ#732245, BZ#732269 - Handle EAGAIN and EINTR in AsyncProc.communicate
Change-Id: I2e0f8494826e9cb0debf8a9d3c9a591ac883b376
diff --git a/vdsm/storage/misc.py b/vdsm/storage/misc.py
index 247211d..3a77b4e 100644
--- a/vdsm/storage/misc.py
+++ b/vdsm/storage/misc.py
@@ -855,7 +855,17 @@ class AsyncProc(object):
# trun on only if data is waiting to be pushed
self._poller.modify(self._fdin, select.EPOLLOUT)
- for fd, event in self._poller.poll(1):
+ try:
+ pollres = self._poller.poll(1)
+ except (OSError, IOError) as e:
+ # Callers will decide if they want to give this another go
+ # or not
+ if e.errno in (errno.EINTR, errno.EAGAIN):
+ pollres = []
+ else:
+ raise
+
+ for fd, event in pollres:
stream = self._fdMap[fd]
if event & select.EPOLLOUT and self._stdin.len > 0:
buff = self._stdin.read(BUFFSIZE)
More information about the vdsm-patches
mailing list