Skip to content

feat(autoscaling): Let callers wake AutoscaledPool immediately with notify() - #2386

Merged
vdusek merged 2 commits into
apify:v2from
Mantisus:notify-pool
Nov 5, 2026
Merged

vdusek merged 2 commits into
apify:v2from
Mantisus:notify-pool

Conversation

@Mantisus

@Mantisus Mantisus commented Nov 2, 2026

Copy link
Copy Markdown
Collaborator

Description

AutoscaledPool.notify() makes a running pool look for a ready task at once, instead of waiting for its next periodic check every 0.5 s. On a pool that isn't running it does nothing.

Nothing in Crawlee calls it yet. A follow-up PR uses it to resume a paced crawl as soon as the request manager reports that work is ready again.

✍️ Drafted by Claude Code

@Mantisus
Mantisus requested a review from vdusek November 2, 2026 15:58
@Mantisus Mantisus self-assigned this Nov 2, 2026
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Nov 2, 2026
@vdusek vdusek changed the title feat(autoscaling): Add AutoscaledPool.notify() feat(autoscaling): Let callers wake AutoscaledPool immediately with notify() Nov 5, 2026
Co-authored-by: Vlada Dusek <v.dusek96@gmail.com>

@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

@vdusek
vdusek merged commit 5e9eb6f into apify:v2 Nov 5, 2026
35 checks passed
Mantisus added a commit to Mantisus/crawlee-python that referenced this pull request Nov 5, 2026
… `notify()` (apify#2386)

### Description

`AutoscaledPool.notify()` makes a running pool look for a ready task at
once, instead of waiting for its next periodic check every 0.5 s. On a
pool that isn't running it does nothing.

Nothing in Crawlee calls it yet. A follow-up PR uses it to resume a
paced crawl as soon as the request manager reports that work is ready
again.

*✍️ Drafted by Claude Code*
vdusek pushed a commit that referenced this pull request Nov 5, 2026
… `notify()` (#2386)

### Description

`AutoscaledPool.notify()` makes a running pool look for a ready task at
once, instead of waiting for its next periodic check every 0.5 s. On a
pool that isn't running it does nothing.

Nothing in Crawlee calls it yet. A follow-up PR uses it to resume a
paced crawl as soon as the request manager reports that work is ready
again.

*✍️ Drafted by Claude Code*
vdusek pushed a commit that referenced this pull request Nov 6, 2026
…` passes (#2393)

### Description

When the request manager reports `waiting` with a `ready_at`, the
crawler schedules a wake-up for that moment, so a paced crawl resumes on
the manager's clock instead of on the autoscaled pool's next poll. This
tightens the dispatch cadence for `ThrottlingRequestManager` cooldowns
and crawl-delays. Only the earliest pending `ready_at` is kept, and a
pending wake-up is dropped when the run ends.

### Issues

- Relates to: #2296
- Follow-up: #2386

*✍️ Drafted by Claude Code*
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