epoll_wait issues when running monkey patched subprocess.check_output

42 views
Skip to first unread message

Jamie Luckett

unread,
Feb 22, 2021, 1:17:35 PM2/22/21
to gevent: coroutine-based Python network library
Hello

We're having issues with gevent when running a monkey-patched subprocess.check_output in a greenlet. While it seems to work most of the time, it is occasionally throwing the following error:
File "/opt/opsview/python3/lib/python3.6/site-packages/gevent/subprocess.py", line 375, in check_output#012    with Popen(*popenargs, stdout=PIPE, **kwargs) as process:#012
File "/opt/opsview/python3/lib/python3.6/site-packages/gevent/subprocess.py", line 751, in __init__#012    restore_signals, start_new_session)#012
File "/opt/opsview/python3/lib/python3.6/site-packages/gevent/subprocess.py", line 1610, in _execute_child#012    data = errpipe_read.read()#012
File "/opt/opsview/python3/lib/python3.6/site-packages/gevent/_fileobjectposix.py", line 164, in readall#012    data = self.__read(DEFAULT_BUFFER_SIZE)#012
File "/opt/opsview/python3/lib/python3.6/site-packages/gevent/_fileobjectposix.py", line 158, in __read#012    wait_on_watcher(self._read_watcher, None, None, self.hub)#012
File "src/gevent/_hub_primitives.py", line 326, in gevent.__hub_primitives.wait_on_watcher#012
File "src/gevent/_hub_primitives.py", line 350, in gevent.__hub_primitives.wait_on_watcher#012
File "src/gevent/_hub_primitives.py", line 304, in gevent.__hub_primitives._primitive_wait#012
File "src/gevent/_hub_primitives.py", line 46, in gevent.__hub_primitives.WaitOperationsGreenlet.wait#012
File "src/gevent/_hub_primitives.py", line 46, in gevent.__hub_primitives.WaitOperationsGreenlet.wait#012
File "src/gevent/_hub_primitives.py", line 55, in gevent.__hub_primitives.WaitOperationsGreenlet.wait#012
File "src/gevent/_waiter.py", line 151, in gevent.__waiter.Waiter.get#012
File "src/gevent/_greenlet_primitives.py", line 61, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch#012
File "src/gevent/_greenlet_primitives.py", line 61, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch#012
File "src/gevent/_greenlet_primitives.py", line 65, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch#012
File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent.__greenlet_primitives._greenlet_switch#012SystemError: (libev) epoll_wait: Invalid argument

After this has happened, gevent.sleep calls also fail with the same error
File "/opt/opsview/orchestrator/venv3/reloadbackup.py", line 51, in process_message#012
File "/opt/opsview/python3/lib/python3.6/site-packages/gevent/hub.py", line 163, in sleep#012    hub.wait(t)#012
File "src/gevent/_hub_primitives.py", line 46, in gevent.__hub_primitives.WaitOperationsGreenlet.wait#012
File "src/gevent/_hub_primitives.py", line 55, in gevent.__hub_primitives.WaitOperationsGreenlet.wait#012
File "src/gevent/_waiter.py", line 151, in gevent.__waiter.Waiter.get#012  File "src/gevent/_greenlet_primitives.py", line 61, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch#012
File "src/gevent/_greenlet_primitives.py", line 61, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch#012
File "src/gevent/_greenlet_primitives.py", line 65, in gevent.__greenlet_primitives.SwitchOutGreenletWithLoop.switch#012
File "src/gevent/__greenlet_primitives.pxd", line 35, in gevent.__greenlet_primitives._greenlet_switch#012SystemError: (libev) epoll_wait: Invalid argument

This is using gevent 1.5.0 and greenlet version 0.4.15 (the latest that gipc support).

Any help is appreciated!
Reply all
Reply to author
Forward
0 new messages