2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-19 14:37:21 +00:00

python/ovs/poller.py: workaround an eventlet bug

Signed-off-by: YAMAMOTO Takashi <yamamoto@valinux.co.jp>
Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
YAMAMOTO Takashi
2013-04-16 15:56:31 +09:00
committed by Ben Pfaff
parent af9fcde70e
commit 73f8280783

View File

@@ -18,6 +18,15 @@ import ovs.vlog
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
@@ -59,6 +68,10 @@ class _SelectSelect(object):
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)