FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(throttling-manager): Stop holding a concurrency slot while a domain is throttled by Mantisus · Pull Request #2176 · apify/crawlee-python · GitHub

fix(throttling-manager): Stop holding a concurrency slot while a domain is throttled - #2176

Merged
vdusek merged 5 commits into
apify:masterfrom
Mantisus:throttling-fetch-request
Aug 21, 2026
Merged

fix(throttling-manager): Stop holding a concurrency slot while a domain is throttled#2176
vdusek merged 5 commits into
apify:masterfrom
Mantisus:throttling-fetch-request

Conversation

Copy link
Copy Markdown
Collaborator

Description

  • fetch_next_request now returns None instead of sleeping out a cooldown, and is_empty() counts only domains that are not throttled, so the autoscaled pool idles instead of holding worker slots. is_finished() still counts every domain, so the crawl does not end while throttled requests are queued. The old sleep occupied a slot while the system read as idle, which pushed desired_concurrency up during the cooldown and burst the moment it expired.

Issues

Testing

  • Update unit tests

Mantisus self-assigned this Aug 19, 2026
vdusek requested review from apify-factory and a balanced review from Copilot August 20, 2026 07:32

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Pull request overview

Updates throttling behavior so cooldowns no longer occupy crawler concurrency slots.

Changes:

  • Return immediately when only throttled requests remain.
  • Treat throttled queues as temporarily empty while keeping the crawl unfinished.
  • Add tests for cooldown, crawl-delay, expiry, and scheduling order.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
src/crawlee/request_loaders/_throttling_request_manager.py Skips throttled domains without waiting and updates readiness semantics.
tests/unit/test_throttling_request_manager.py Verifies non-blocking throttling and domain scheduling behavior.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

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.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

LGTM

vdusek requested review from Pijukatel and removed request for apify-factory August 20, 2026 12:03
vdusek merged commit 5c1fa09 into apify:master Aug 21, 2026
34 checks passed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

ThrottlingRequestManager.fetch_next_request holds a concurrency slot while waiting out a throttle

4 participants


Back | FazBrowse Home | New Git URL