You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by kg...@apache.org on 2014/05/30 15:08:23 UTC

svn commit: r1598586 - /qpid/trunk/qpid/python/qpid/compat.py

Author: kgiusti
Date: Fri May 30 13:08:23 2014
New Revision: 1598586

URL: http://svn.apache.org/r1598586
Log:
QPID-5790: avoid use of poll if select is monkey-patched by Eventlet/Greenthreads

Modified:
    qpid/trunk/qpid/python/qpid/compat.py

Modified: qpid/trunk/qpid/python/qpid/compat.py
URL: http://svn.apache.org/viewvc/qpid/trunk/qpid/python/qpid/compat.py?rev=1598586&r1=1598585&r2=1598586&view=diff
==============================================================================
--- qpid/trunk/qpid/python/qpid/compat.py (original)
+++ qpid/trunk/qpid/python/qpid/compat.py Fri May 30 13:08:23 2014
@@ -40,10 +40,18 @@ except ImportError:
   def format_exc():
     return "".join(traceback.format_exception(*sys.exc_info()))
 
-# prefer poll() to select(), as it performs better at scale:
+# QPID-5588: prefer poll() to select(), as it allows file descriptors with
+# values > FD_SETSIZE
 import select as _select_mod
-if hasattr(_select_mod, "poll"):
+try:
+  # QPID-5790: unless eventlet/greenthreads have monkey-patched the select
+  # module, as to date poll() is not properly supported by eventlet
+  import eventlet
+  _is_patched = eventlet.patcher.is_monkey_patched("select")
+except ImportError:
+  _is_patched = False
 
+if hasattr(_select_mod, "poll") and not _is_patched:
   from select import error as SelectError
   def select(rlist, wlist, xlist, timeout=None):
     fd_count = 0



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org