Fixed
The HTTP distributor was calling asyncio.wait with an empty iterable,
and this was causing an exception. We now avoid that condition.
@@ -72,6 +72,7 @@ class HttpDistributor(Distributor):
for work_item in pending_work:
# Wait for an available URL
while not urls:
+ assert fetchers.keys()
done, pending = await asyncio.wait(fetchers.keys(), return_when=asyncio.FIRST_COMPLETED)
for task in done:
await handle_completed_task(task)
@@ -84,6 +85,7 @@ class HttpDistributor(Distributor):
fetchers[fetcher] = url, work_item.job_id
# Drain the remaining work
+ if fetchers.keys():
done, pending = await asyncio.wait(fetchers.keys(), return_when=asyncio.ALL_COMPLETED)
for task in done:
await handle_completed_task(task)
