FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

fix(storage): only backoff before resume attempts by coryan · Pull Request #14427 · googleapis/google-cloud-cpp · GitHub

fix(storage): only backoff before resume attempts - #14427

Merged
coryan merged 2 commits into
googleapis:mainfrom
coryan:fix-storage-only-sleep-before-resume-attempts
Jul 3, 2024
Merged

fix(storage): only backoff before resume attempts#14427
coryan merged 2 commits into
googleapis:mainfrom
coryan:fix-storage-only-sleep-before-resume-attempts

Conversation

coryan commented Jul 3, 2024
edited
Loading

Copy link
Copy Markdown
Contributor

storage::Client::ReadObject() resumes a download that gets
interrupted (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 newly
created source of data. That effectively doubles the backoff time.

Fixes #14424


This change is 

product-auto-label Bot added the api: storage Issues related to the Cloud Storage API. label Jul 3, 2024

codecov Bot commented Jul 3, 2024
edited
Loading

Copy link
Copy Markdown

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 93.59%. Comparing base (c39fb3a) to head (9374247).
Report is 1 commits behind head on main.

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.
📢 Have feedback on the report? Share it here.

`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.
coryan force-pushed the fix-storage-only-sleep-before-resume-attempts branch from 5e65592 to eacd9e4 Compare July 3, 2024 18:19
coryan marked this pull request as ready for review July 3, 2024 18:42
coryan requested review from a team July 3, 2024 18:42
HttpResponse{100, "", {}}}));
EXPECT_CALL(*source, Read).WillOnce(Return(TransientError()));
// No backoffs to resume after a (partially) successful request:
// EXPECT_CALL(backoff, Call).Times(1);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

remove?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done.

@@ -222,21 +224,22 @@ TEST(RetryObjectReadSourceTest, BackoffPolicyResetOnSuccess) {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

s/closed/cloned/ on L217

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Done.

coryan enabled auto-merge (squash) July 3, 2024 20:20
coryan merged commit f54ba19 into googleapis:main Jul 3, 2024
coryan deleted the fix-storage-only-sleep-before-resume-attempts branch July 3, 2024 21:23
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

Labels

api: storage Issues related to the Cloud Storage API.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Client library sleeps after successfully resuming a download

2 participants


Back | FazBrowse Home | New Git URL