
Since commit f37a87b
the internal implementation of tpool uses sockets
instead of pipes for communication. If, for whatever reason, the user code
calls socket.setdefaulttimeout() with some nonzero value, tpool's internal
socket now inherits this timeout. This causes the tpool to receive
a `socket.timeout` exception where none was expected.
https://github.com/eventlet/eventlet/pull/330
16 lines
284 B
Python
16 lines
284 B
Python
__test__ = False
|
|
|
|
if __name__ == '__main__':
|
|
import eventlet
|
|
import eventlet.tpool
|
|
import socket
|
|
|
|
def do():
|
|
eventlet.sleep(0.2)
|
|
return True
|
|
|
|
socket.setdefaulttimeout(0.05)
|
|
result = eventlet.tpool.execute(do)
|
|
assert result
|
|
print('pass')
|