Skip to content

fix: add retry to getting GCS client config #3930

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

Merged
merged 3 commits into from
Mar 7, 2025
Merged

Conversation

kevinzwang
Copy link
Member

@kevinzwang kevinzwang commented Mar 7, 2025

Also contains a tiny refactor to centralize logic for exponential backoff retry

@github-actions github-actions bot added the fix label Mar 7, 2025
Copy link

codecov bot commented Mar 7, 2025

Codecov Report

Attention: Patch coverage is 46.83544% with 42 lines in your changes missing coverage. Please review.

Project coverage is 78.52%. Comparing base (5618f21) to head (4166da1).
Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
src/daft-io/src/google_cloud.rs 0.00% 15 Missing ⚠️
src/daft-io/src/s3_like.rs 42.30% 15 Missing ⚠️
src/daft-io/src/retry.rs 68.42% 12 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #3930      +/-   ##
==========================================
- Coverage   78.52%   78.52%   -0.01%     
==========================================
  Files         772      773       +1     
  Lines       98313    98366      +53     
==========================================
+ Hits        77204    77237      +33     
- Misses      21109    21129      +20     
Files with missing lines Coverage Δ
src/daft-io/src/lib.rs 75.94% <ø> (+1.65%) ⬆️
src/daft-io/src/retry.rs 68.42% <68.42%> (ø)
src/daft-io/src/google_cloud.rs 0.00% <0.00%> (ø)
src/daft-io/src/s3_like.rs 67.06% <42.30%> (+0.10%) ⬆️

... and 1 file with indirect coverage changes

🚀 New features to boost your workflow:
  • Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

HttpError(reqwest_err)
if reqwest_err
.status()
.is_some_and(|status| status.as_u16() == 401) =>
Copy link
Member

Choose a reason for hiding this comment

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

So my understanding is that the 401 actually comes from when this fails, the client goes into anon mode and then does a request to GCS without credentials. That error is the 401.

Based off the user logs, the credential error can actually be some other http error (pretty sure its not 401)

(ScanWithTask-FanoutEvenSlices [Stage:2] pid=2781, ip=10.68.5.21) Google Cloud Storage Credentials not provided or found when making client. Reverting to Anonymous mode.
(ScanWithTask-FanoutEvenSlices [Stage:2] pid=2781, ip=10.68.5.21) Details
(ScanWithTask-FanoutEvenSlices [Stage:2] pid=2781, ip=10.68.5.21) Unable to load Credentials: http error: error sending request for url (https://oauth2.googleapis.com/token)

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm should we just retry on any HTTP error then?

Copy link
Member

Choose a reason for hiding this comment

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

Okay so I think we want to retry when the reqwest error type is Kind::Request or if the error code is the standard retry able stuff like 429 or 5XX

Copy link
Member

Choose a reason for hiding this comment

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

Something like this should work

                        HttpError(reqwest_err)
                            if reqwest_err.is_request() || reqwest_err.is_timeout() || matches!(reqwest_err.status().map(|s| s.as_u16()), Some(429) | Some(500..599))  =>

@kevinzwang kevinzwang merged commit 1d2acce into main Mar 7, 2025
55 of 56 checks passed
@kevinzwang kevinzwang deleted the kevin/gcs-cred-retry branch March 7, 2025 23:20
kevinzwang added a commit that referenced this pull request Mar 8, 2025
Also contains a tiny refactor to centralize logic for exponential
backoff retry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants