-
Notifications
You must be signed in to change notification settings - Fork 377
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix(storage): only backoff before resume attempts #14427
fix(storage): only backoff before resume attempts #14427
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #14427 +/- ##
=======================================
Coverage 93.58% 93.59%
=======================================
Files 2313 2313
Lines 206951 206983 +32
=======================================
+ Hits 193680 193716 +36
+ Misses 13271 13267 -4 ☔ View full report in Codecov by Sentry. |
`storage::Client::ReadObject()` resumes a download that gets interrupted (controlled by policy). On the first resume attempt, the library does not back off (sleep), becuase there is no reason to believe the problem is load related. If the first resume fails, the library backsoff before each attempt, as the problem might be load related after this point. The library was *also* backing off before issuing the first `Read()` on the newly created source of data. That effectively doubles the backoff time, and leaves the resumed connection idle for (potentially) a long time when there are multiple resume attempts needed.
5e65592
to
eacd9e4
Compare
HttpResponse{100, "", {}}})); | ||
EXPECT_CALL(*source, Read).WillOnce(Return(TransientError())); | ||
// No backoffs to resume after a (partially) successful request: | ||
// EXPECT_CALL(backoff, Call).Times(1); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
@@ -222,21 +224,22 @@ TEST(RetryObjectReadSourceTest, BackoffPolicyResetOnSuccess) { | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
s/closed/cloned/ on L217
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
storage::Client::ReadObject()
resumes a download that getsinterrupted (controlled by policy). Before making a resume attempt, the
library backsoff in case the problem is load related. The library was
also backing off before issuing the first
Read()
on the newlycreated source of data. That effectively doubles the backoff time.
Fixes #14424
This change is