Repository navigation
Don't mark the first V2 feed request as a retry - #7841
Merged
Nigusu-Allehu merged 1 commit intoNov 4, 2026
Merged
Conversation
The uncached branch of V2FeedParser.QueryV2FeedAsync set IsRetry = true, so HttpRetryHandler waited out the retry delay before sending the first request.
jeffkl
approved these changes
Nov 2, 2026
zivkan
approved these changes
Nov 3, 2026
This was referenced Nov 4, 2026
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.
Bug
Fixes: NuGet/Home#12195
Description
SearchAsyncagainst a V2 feed waits about a second before it sends its first request. As @jeffkl traced in the issue,V2FeedParser.Searchpasses a nullSourceCacheContext, soQueryV2FeedAsynctakes its uncached branch, and that branch setsIsRetry = trueon the request.HttpRetryHandlertreatstries > 0 || request.IsRetryas a retry, so it waitsRetryDelayplus up to 200 ms before the first send.I removed the
IsRetry = true. The request still gets its normal retries when it fails, because those are counted bytries. The flag is also passed to the HTTP diagnostic events, so a first request no longer reports itself as a retry there. I couldn't find a reason for it in the code, and the other callers only setIsRetryfrom their retry counter (retry > 1).The issue triage mentions NuGet/Home#12215 as a likely shared cause. This only changes the V2 search path.
Test: new
V2FeedParser_Search_FirstRequestIsNotMarkedAsRetrycaptures the request sent to the retry handler. It fails ondev.NuGet.Protocol.Testson net10.0, filtered toV2FeedParser,HttpSource,HttpRetryHandlerandPackageSearchResourceV2: 104 passed, 2 skipped.PR Checklist