Skip to content

fix(basic): empty a lazily-opened inner queue in ThrottlingRequestManager.purge() - #4394

Merged
janbuchar merged 3 commits into
apify:masterfrom
VolodymyrLinuxovich:fix/throttling-purge-unopened-inner
Nov 20, 2026
Merged

janbuchar merged 3 commits into
apify:masterfrom
VolodymyrLinuxovich:fix/throttling-purge-unopened-inner

Conversation

@VolodymyrLinuxovich

Copy link
Copy Markdown
Contributor

When inner is omitted or passed as a factory, purge() and drop() only reached the wrapped manager if it was already open. In a new process with purgeOnStart disabled, the requests a previous run left in the wrapped queue survived a purge and were crawled.

Both methods now open the wrapped manager first. setExpectedRequestProcessingTime() still does not force it open.

The test that expected purge and drop to leave the factory uncalled now covers only the hint. New tests cover a factory inner, an omitted inner and drop(). They fail without the fix.

Closes #4391

…ager.purge()

purge() and drop() skipped the wrapped manager when it had not been opened yet, so with purgeOnStart disabled the requests a previous run left in it were still crawled. Both now open it first.

Closes apify#4391
@github-actions github-actions Bot added the t-tooling Issues with this label are in the ownership of the tooling team. label Nov 12, 2026
@janbuchar
janbuchar self-requested a review November 12, 2026 14:08

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

@janbuchar
janbuchar enabled auto-merge (squash) November 20, 2026 22:21
@janbuchar
janbuchar merged commit 377c7a4 into apify:master Nov 20, 2026
10 checks passed
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.

v4: ThrottlingRequestManager.purge() doesn't empty a wrapped queue it hasn't opened yet

2 participants