Skip to content

Commit 7771658

Browse files
committed
Some unimaginable execption is raised in autoscaled pool. What is it? Add debug
1 parent 72f8451 commit 7771658

1 file changed

Lines changed: 6 additions & 1 deletion

File tree

src/crawlee/_autoscaling/autoscaled_pool.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,6 +131,10 @@ async def run(self) -> None:
131131
for task in run.worker_tasks:
132132
if not task.done():
133133
task.cancel()
134+
except Exception as exc:
135+
logger.error('Something sinister happened', exc_info=exc)
136+
raise
137+
134138
finally:
135139
with suppress(asyncio.CancelledError):
136140
await self._autoscale_task.stop()
@@ -218,7 +222,7 @@ async def _worker_task_orchestrator(self, run: _AutoscaledPoolRun) -> None:
218222
Exits when `is_finished_function` returns True.
219223
"""
220224
finished = False
221-
225+
logger.info('_worker_task_orchestrator')
222226
try:
223227
while not (finished := await self._is_finished_function()) and not run.result.done():
224228
run.worker_tasks_updated.clear()
@@ -246,6 +250,7 @@ async def _worker_task_orchestrator(self, run: _AutoscaledPoolRun) -> None:
246250
with suppress(asyncio.TimeoutError):
247251
await asyncio.wait_for(run.worker_tasks_updated.wait(), timeout=0.5)
248252
finally:
253+
logger.info('Finally pool')
249254
if finished:
250255
logger.info('`is_finished_function` reports that we are finished')
251256
elif run.result.done() and run.result.exception() is not None:

0 commit comments

Comments
 (0)