Skip to content

fix: use time.monotonic() in ThrottlingRequestManager - #2567

Open
theluckystrike wants to merge 1 commit into
apify:masterfrom
theluckystrike:fix/monotonic-throttling-clock
Open

theluckystrike wants to merge 1 commit into
apify:masterfrom
theluckystrike:fix/monotonic-throttling-clock

Conversation

@theluckystrike

Copy link
Copy Markdown

Fixes #2527.

ThrottlingRequestManager tracked 429 backoffs, crawl delays, and max_domain_stall windows using datetime.now(timezone.utc), so NTP adjustments or system clock changes could extend cooldowns or expire them early. Switch internal timestamps and _DomainState clocks to time.monotonic().

@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Dec 2, 2026
@vdusek
vdusek requested a review from Mantisus December 2, 2026 14:01

@Mantisus Mantisus 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.

Hi @theluckystrike,

Thanks for your contribution! Could you please add and update the tests, and run the lint and format checks locally (uv run poe lint and uv run poe format) as described in CONTRIBUTING.md?

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.

ThrottlingRequestManager cooldowns shift when the system clock changes

2 participants