diff options
author | Sergey Shepelev <temotor@gmail.com> | 2017-09-07 09:27:54 +0300 |
---|---|---|
committer | Sergey Shepelev <temotor@gmail.com> | 2017-09-07 09:28:56 +0300 |
commit | 82f1877ff5b950e1ee9debbb8be880ebedb8abcb (patch) | |
tree | 2ec66c8c561dd28460c972e72ab7bc62d52031cf | |
parent | b756447bab51046dfc6f1e0e299cc997ab343701 (diff) | |
download | eventlet-82f1877ff5b950e1ee9debbb8be880ebedb8abcb.tar.gz |
init: second workaround for monotonic "no suitable implementation"; Thanks to Geoffrey Thomasmonotonic-401
Force sooner find_library child process by early import monotonic.
Helps with gunicorn and possibly other applications.
https://github.com/eventlet/eventlet/issues/401
https://github.com/benoitc/gunicorn/issues/1584
-rw-r--r-- | eventlet/__init__.py | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/eventlet/__init__.py b/eventlet/__init__.py index 9da3cfd..fd50869 100644 --- a/eventlet/__init__.py +++ b/eventlet/__init__.py @@ -17,6 +17,12 @@ if os.environ.get('EVENTLET_IMPORT_VERSION_ONLY') != '1': from eventlet import support from eventlet import timeout import greenlet + # Force monotonic library search as early as possible. + # Helpful when CPython < 3.5 on Linux blocked in `os.waitpid(-1)` before first use of hub. + # Example: gunicorn + # https://github.com/eventlet/eventlet/issues/401#issuecomment-327500352 + from eventlet.support import monotonic + del monotonic connect = convenience.connect listen = convenience.listen @@ -58,3 +64,5 @@ if os.environ.get('EVENTLET_IMPORT_VERSION_ONLY') != '1': ('exc_after', 'greenthread.exc_after', greenthread.exc_after), ('call_after_global', 'greenthread.call_after_global', greenthread.call_after_global), )) + +del os |