Fix recursive fan-out and request deduplication - #1
Open
iGotYourBackMr wants to merge 1 commit into
Open
iGotYourBackMr wants to merge 1 commit into
iGotYourBackMr wants to merge 1 commit 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.
PR lycheeverse#2283 currently avoids a bounded feedback-channel stall by spawning one task per discovered URL, but recursive requests can still be duplicated and the spawned tasks act as an unbounded queue with extra overhead.
This patch switches the feedback path to an unbounded channel directly and atomically records each discovered URI before enqueueing it. Initial input URIs seed the same set so a cycle cannot immediately enqueue a starting page again. It also adds a deterministic regression where two pages discover the same delayed target: the unmodified branch makes four requests and reaches the target twice, while this patch makes three requests and reaches it once.
Validation:
cargo test -p lychee --all-features --test cli recursive: 8 passedcargo clippy -p lychee --all-features --bin lychee --test cli -- -D warnings: passedcargo fmt --all -- --check: passedThis is one commit on top of lycheeverse#2283 commit
9623a957. The implementation and tests were AI-assisted by OpenAI Codex on behalf ofiGotYourBackMr.