Skip to content

feat(autoscaling)!: Make AutoscaledPool.pause() wait for the running tasks - #2365

Open
Mantisus wants to merge 2 commits into
apify:v2from
Mantisus:pause-pool
Open

Mantisus wants to merge 2 commits into
apify:v2from
Mantisus:pause-pool

Conversation

@Mantisus

Copy link
Copy Markdown
Collaborator

Description

AutoscaledPool.pause() is now a coroutine that returns once the pool's tasks in progress finish, like pause() in Crawlee JS. With the new timeout option, it raises TimeoutError if they take longer, and the pool stays paused. Nothing in Crawlee calls it yet. The crawler's pause() and resume() and pausing on migration need the per-run state from #2301. The upgrade guide covers the change.

Where Crawlee JS doesn't keep the contract its pause() documents, this PR keeps it. A repeated pause() also waits for the tasks in progress. A pause() that comes while the pool awaits is_task_ready_function or is_finished_function doesn't let a new task start or run() return.

✍️ Drafted by Claude Code

@Mantisus Mantisus self-assigned this Oct 29, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Oct 29, 2026
@Mantisus
Mantisus requested review from Pijukatel and vdusek October 29, 2026 23:48

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

t-tooling Issues with this label are in the ownership of the tooling team.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants