chore: stop standby requests from spawning duplicate crawlers - #135
Draft
nikitachapovskii-dev wants to merge 2 commits into
Draft
chore: stop standby requests from spawning duplicate crawlers#135nikitachapovskii-dev wants to merge 2 commits into
nikitachapovskii-dev wants to merge 2 commits into
Conversation
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.
getCrawlerKey was JSON.stringify(crawlerOptions), which serialized the constructed ProxyConfiguration including its child logger. debugMode flips the process-wide log level, so a single standby request changed one byte of the key, missed the pre-started crawlers, and forked new ones. Nothing evicts crawlers, so each fork leaks for the life of the run.
The log level is now set once from the run input. A request's own debugMode still fills the debug field of its response.
The key is now a hash of the settings that need a separate crawler, taken from the caller's proxy options rather than the constructed instance. The proxy password no longer lands in the key, which is logged and used as the request queue name.
Which settings deserve their own crawler is unchanged here; that's the follow-up PR.
Related to #60