Skip to content
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

feat(storage): improve error messages on stalled uploads #9744

Merged

Conversation

coryan
Copy link
Contributor

@coryan coryan commented Aug 29, 2022

This change is Reviewable

@product-auto-label product-auto-label bot added the api: storage Issues related to the Cloud Storage API. label Aug 29, 2022
@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: da88a6a952f2dc40f9bb439097f9e1da4e9da5c7

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 569905a5c74a013de870d58d579ab4a7d10afd30

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@codecov
Copy link

codecov bot commented Aug 29, 2022

Codecov Report

Merging #9744 (535e818) into main (18f4df8) will decrease coverage by 0.00%.
The diff coverage is 95.00%.

@@            Coverage Diff             @@
##             main    #9744      +/-   ##
==========================================
- Coverage   93.87%   93.87%   -0.01%     
==========================================
  Files        1498     1498              
  Lines      139564   139588      +24     
==========================================
+ Hits       131016   131036      +20     
- Misses       8548     8552       +4     
Impacted Files Coverage Δ
google/cloud/storage/internal/retry_client.cc 99.68% <95.00%> (-0.32%) ⬇️
google/cloud/storage/parallel_upload.cc 98.26% <0.00%> (-0.35%) ⬇️
...cloud/pubsub/internal/subscription_session_test.cc 97.82% <0.00%> (-0.17%) ⬇️

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@coryan coryan marked this pull request as ready for review August 29, 2022 21:15
@coryan coryan requested a review from a team as a code owner August 29, 2022 21:15
Copy link
Member

@scotthart scotthart left a comment

Choose a reason for hiding this comment

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

Reviewed 1 of 1 files at r2, all commit messages.
Reviewable status: :shipit: complete! all files reviewed, all discussions resolved (waiting on @coryan)

@@ -154,6 +154,42 @@ bool UploadChunkOnFailure(RetryPolicy& retry_policy, int& count,
return retry_policy.OnFailure(status);
}

Status RetryError(Status const& last_status, RetryPolicy const& retry_policy,
char const* error_message) {
Copy link
Contributor

Choose a reason for hiding this comment

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

error_message seems a little misleading in the context of "... in <error_message>".

Previously we seem to have used char const* location or char const* function_name.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

std::ostringstream os;
os << "All requests (" << upload_count << ") have succeeded, but they have"
<< " not completed the full write. The expected committed size is "
<< expected_committed_size << " the current committed size is "
Copy link
Contributor

Choose a reason for hiding this comment

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

s/the/and the/?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed

@@ -494,8 +530,10 @@ StatusOr<EmptyResponse> RetryClient::DeleteResumableUpload(
//
StatusOr<QueryResumableUploadResponse> RetryClient::UploadChunk(
UploadChunkRequest const& request) {
Status last_status(StatusCode::kDeadlineExceeded,
"Retry policy exhausted before first attempt was made.");
auto const initial_status =
Copy link
Contributor

Choose a reason for hiding this comment

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

initial_status seems to be unused.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Fixed.

@google-cloud-cpp-bot
Copy link
Collaborator

Google Cloud Build Logs
For commit: 535e8186c8f40468c8c66b7bc760c3f8ba4a4e14

ℹ️ NOTE: Kokoro logs are linked from "Details" below.

@coryan coryan merged commit 5aeed09 into googleapis:main Aug 30, 2022
@coryan coryan deleted the feat-storage-improve-retry-error-messages branch August 30, 2022 01:27
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.

4 participants