1
votes

Running gevent pool gives me the following exception on join:

return greenlet.switch(self)

gevent.hub.LoopExit: ('This operation would block forever', Hub at 0x105cbd190 select default pending=0 ref=0)

Code is:

    queue = gevent.queue.Queue(items=range(5))
    pool = gevent.pool.Pool(3)
    pool.map(self.foo_index, queue)
    pool.join(raise_error=True)

The error seems to occur before join is called during map. Oh no wait, an exception is raised immediately which must come from join: this is confusing.

2

2 Answers

0
votes

Using map_async on your sample code did resolved the issue on my side. I hope this is what you are looking for.

0
votes

The error is raised because of the gevent.queue.Queue object. I replaced it with a default list and now it works. Not sure why the Queue is a problem, as it seems to be an iterable.