Skip to content

fix: Correctly track the number of requests handled by a crawler#3410

Open
janbuchar wants to merge 1 commit intomasterfrom
correctly-track-handled-request-count
Open

fix: Correctly track the number of requests handled by a crawler#3410
janbuchar wants to merge 1 commit intomasterfrom
correctly-track-handled-request-count

Conversation

@janbuchar
Copy link
Contributor

@janbuchar janbuchar commented Feb 13, 2026

@janbuchar janbuchar added the t-tooling Issues with this label are in the ownership of the tooling team. label Feb 13, 2026
@janbuchar janbuchar requested review from B4nan, barjin and l2ysho February 13, 2026 09:45
@github-actions github-actions bot added this to the 134th sprint - Tooling team milestone Feb 13, 2026
@github-actions github-actions bot added the tested Temporary label used only programatically for some analytics. label Feb 13, 2026
Copy link
Member

@barjin barjin left a comment

Choose a reason for hiding this comment

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

lgtm, thanks!

I'd be more cautious about the breaking change, but I'll leave it up to you.

protected handledRequestsCount = 0;

protected get handledRequestsCount(): number {
return this.stats.state.requestsFinished + this.stats.state.requestsFailed;
Copy link
Member

@barjin barjin Feb 13, 2026

Choose a reason for hiding this comment

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

Side note: the failed requests are technically also "finished" (word-wise, not in Crawlee), I lobby for renaming this to requestsSucceeded in v4.

@B4nan
Copy link
Member

B4nan commented Feb 13, 2026

My point stands, do we really care for v3? I would postpone for v4, breaking change is a breaking change, there are many other users outside of Apify, so just checking their projects doesn't feel like strong evidence to me.

Or does this block anyone? I thought it was just a random finding of ours, and in such case, I would target v4 to stay on the safe side.

edit: hmm I do see the setter there, so I guess the PR description is not up to date?

@janbuchar
Copy link
Contributor Author

edit: hmm I do see the setter there, so I guess the PR description is not up to date?

Just a poor choice of words, sorry. The setter is there, but it throws an error.

My point stands, do we really care for v3? I would postpone for v4,
Or does this block anyone? I thought it was just a random finding of ours, and in such case, I would target v4 to stay on the safe side.

Its related to the same logic as #3153, which should probably be fixed sooner than v4. And I'd like to be able to keep "we're fixing those maxCrawlPages issues in v3" as a ground truth in my head, instead of making reality more complicated than that.

breaking change is a breaking change,

Fixing a bug is a breaking change, renaming BasicCrawler is a breaking change as well. But it'd be quite a stretch to call these equal. This is removing an undocumented property accessible only by inheritance from a class not particularly well suited for being extended by end users.

there are many other users outside of Apify, so just checking their projects doesn't feel like strong evidence to me.

Fair enough, but it is a signal, albeit a weak one.

If you think strongly about this, I'm not opposed to rebasing the PR onto v4, but I believe that the breaking-ness of this change is closer to the "making stuff work as originally intended" end of the spectrum.

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. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Sharing the RequestManager instance breaks maxRequestsPerCrawl limits Remove BasicCrawler.handledRequestsCount

3 participants