[BUG] Do not queue a curl session closed by the Retry-After cap - #4632
Open
ThomsonTan wants to merge 3 commits into
Open
ThomsonTan wants to merge 3 commits into
ThomsonTan wants to merge 3 commits into
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #4632 +/- ##
==========================================
+ Coverage 86.52% 86.64% +0.13%
==========================================
Files 525 525
Lines 20475 20475
==========================================
+ Hits 17713 17738 +25
+ Misses 2762 2737 -25
🚀 New features to boost your workflow:
|
lalitb
reviewed
Sep 23, 2026
|
|
||
| started_at = std::chrono::steady_clock::now(); | ||
| http_client.WaitBackgroundThreadExit(); | ||
| const auto joined_in = std::chrono::steady_clock::now() - started_at; |
Member
There was a problem hiding this comment.
Non-blocking: could we add a separate case that calls WaitBackgroundThreadExit() immediately after the capped request finishes, without sending the second request?
Here, the original bug spends the 30 seconds waiting for the second request to retry, so the later join can still return promptly. The retry assertion catches the bug, but a separate case would directly cover the shutdown scenario from #4631.
lalitb
approved these changes
Sep 23, 2026
lalitb
left a comment
Member
There was a problem hiding this comment.
LGTM, thanks for the quick fix!
This branch has not been deployed
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.
Fixes #4631
Changes
When a retryable response carries a Retry-After beyond max_backoff,
PerformCurlMessage() closes the session with Cleanup(). The IO loop then
asked IsRetryable() again, still got true, and queued the closed session
at the server's retry time. doRetrySessions() stops at the first entry
that is not due, so that entry held back every later retry on the client
and kept the background thread alive. WaitBackgroundThreadExit() and
~HttpClient() could not join until the server's time, and the loop
busy-spun meanwhile.
For significant contributions please make sure you have completed the following items:
CHANGELOG.mdupdated for non-trivial changes