pediapress / mwlib

mediawiki parser library
103 stars 35 forks source link

Race condition in net/fetch.py #55

Open bradbeattie opened 8 years ago

bradbeattie commented 8 years ago
def run(self):
    self.report()
    dispatch_gr = gevent.spawn(callwhen, self.dispatch_event, self.dispatch)
    try:
        self.pool.join()
    finally:
        dispatch_gr.kill()

If the pool completes before the dispatch_gr is given processing time, doesn't this just end up killing dispatch_gr? If so, _refcall to fetch_imageinfo never occurs and assert not self.imageinfo_todo fails.