Skip to content

Commit

Permalink
python/ovs/poller.py: workaround an eventlet bug
Browse files Browse the repository at this point in the history
Signed-off-by: YAMAMOTO Takashi <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
yamt authored and blp committed Apr 16, 2013
1 parent af9fcde commit 73f8280
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions python/ovs/poller.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,15 @@
import select
import socket

try:
import eventlet.patcher

def _using_eventlet_green_select():
return eventlet.patcher.is_monkey_patched(select)
except:
def _using_eventlet_green_select():
return False

vlog = ovs.vlog.Vlog("poller")

POLLIN = 0x001
Expand Down Expand Up @@ -59,6 +68,10 @@ def poll(self, timeout):
timeout = None
else:
timeout = float(timeout) / 1000
# XXX workaround a bug in eventlet
# see https://github.com/eventlet/eventlet/pull/25
if timeout == 0 and _using_eventlet_green_select():
timeout = 0.1

rlist, wlist, xlist = select.select(self.rlist, self.wlist, self.xlist,
timeout)
Expand Down

0 comments on commit 73f8280

Please sign in to comment.