fix: arun_many respects CrawlerRunConfig.semaphore_count (#1818)#1861
Open
hafezparast wants to merge 1 commit intounclecode:developfrom
Open
fix: arun_many respects CrawlerRunConfig.semaphore_count (#1818)#1861hafezparast wants to merge 1 commit intounclecode:developfrom
hafezparast wants to merge 1 commit intounclecode:developfrom
Conversation
) arun_many() was creating MemoryAdaptiveDispatcher with the default max_session_permit=20, ignoring config.semaphore_count entirely. This caused deep crawl to launch up to 20 concurrent browser pages against a single site, overwhelming servers that can't handle that load and causing Page.goto timeouts on all subpages. Now passes config.semaphore_count as max_session_permit to the dispatcher. The default (5) is already more conservative than the previous hardcoded 20. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
arun_many()was creatingMemoryAdaptiveDispatcherwith defaultmax_session_permit=20, completely ignoringCrawlerRunConfig.semaphore_countPage.goto: Timeouton all subpagessemaphore_count=1) had no effect because the value was silently ignoredconfig.semaphore_countasmax_session_permitto the dispatcher (one-line change)The previous fix (PR #1829) targeted session-page reuse (
window.stop()), but deep crawl assigns each URL a unique session_id — there is no page reuse, so that fix was irrelevant to this bug.Fixes #1818
Test plan
CrawlerRunConfig(semaphore_count=1)now producesMemoryAdaptiveDispatcher(max_session_permit=1)semaphore_count=5is more conservative than the previous hardcoded 20simon.com.cn/caseno longer times out🤖 Generated with Claude Code