Skip to content

fix(autoscaling): Keep min_concurrency tasks running while the system is overloaded - #2235

Merged
vdusek merged 4 commits into
apify:masterfrom
Mantisus:fix-pool-overload-freeze
Sep 16, 2026
Merged

vdusek merged 4 commits into
apify:masterfrom
Mantisus:fix-pool-overload-freeze

Conversation

@Mantisus

Copy link
Copy Markdown
Collaborator

Description

  • Keep min_concurrency tasks running while the system is overloaded instead of dropping to zero concurrency. It fixes AutoscaledPool freezing after an overload.

Testing

  • Added a new unit test test_keeps_min_concurrency_when_overloaded

@Mantisus
Mantisus requested a review from vdusek September 15, 2026 20:25
@Mantisus Mantisus self-assigned this Sep 15, 2026

@vdusek vdusek left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM... But @Pijukatel could you take a look as well? I don't think this could cause any harm, but touching the autoscaled pool always makes me nervous 😄

@vdusek
vdusek requested a review from Pijukatel September 16, 2026 09:42

@Pijukatel Pijukatel left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It seems reasonable to me, but this would be worth syncing with the JS version of the tooling - especially with the upcoming v4 release.

@vdusek

vdusek commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator

Issue: apify/crawlee#4129, but it seems a JS version already behaves this way.

@vdusek
vdusek merged commit cbaefb4 into apify:master Sep 16, 2026
34 checks passed
@Mantisus

Mantisus commented Sep 16, 2026

Copy link
Copy Markdown
Collaborator Author

but it seems a JS version already behaves this way.

Yes, I checked the behavior in TS before making the fix.

vdusek added a commit to Kuang-xianxin/crawlee-python that referenced this pull request Sep 16, 2026
Resolved a conflict in the `AutoscaledPool` class docstring, where apify#2235 rewrote the concurrency sentence while this branch extended the error sentence. The merged text keeps both.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants