New patch submitted by Saggi Mizrahi (smizrahi(a)redhat.com)
You can review this change at:
http://gerrit.usersys.redhat.com/865
commit 77cbfcc06bc83280d21478a16c4a531de8491e2d
Author: Saggi Mizrahi <smizrahi(a)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 b16df9b..79fc3cc 100644
--- a/vdsm/storage/misc.py
+++ b/vdsm/storage/misc.py
@@ -855,7 +855,16 @@ 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):
+ pollres = None
+ while pollres is None:
+ try:
+ pollres = self._poller.poll(1)
+ except OSError as e:
+ if e.errno in (errno.EINTR, errno.EAGAIN):
+ continue
+ raise
+
+ for fd, event in pollres:
stream = self._fdMap[fd]
if event & select.EPOLLOUT and self._stdin.len > 0:
buff = self._stdin.read(BUFFSIZE)