eventlet.GreenPool.waitall() just logs the exception but doesn't raise them

waitall() method in eventlet.GreenPool doesn't raise exceptions but just logs them, whereas in case of wait on the greenthread returned by spawn from evenlet.GreenPool raises the exception.

# cat foo.py 
import eventlet
pool = eventlet.GreenPool(1)
def foo():
     raise ValueError

gt = pool.spawn(foo)
try:
    pool.waitall()
except Exception, e:
    print "pool.waitall Exception raised: %r" % e

try:
    gt.wait()
except Exception, e:
    print "gt.wait() Exception raised: %r" % e

# python foo.py 
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/eventlet/hubs/hub.py", line 346, in fire_timers
    timer()
  File "/usr/lib/python2.7/site-packages/eventlet/hubs/timer.py", line 56, in __call__
    cb(*args, **kw)
  File "/usr/lib/python2.7/site-packages/eventlet/greenthread.py", line 194, in main
    result = function(*args, **kwargs)
  File "foo.py", line 4, in foo
    raise ValueError
ValueError
gt.wait() Exception raised: ValueError()

Comments

Popular posts from this blog

Multiple repeat error when the regex has multiple wildcards in python re module

Weakref proxy is for instance only ...

To speed up accessing files on nfs shares on a ubuntu machine ...