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

[CHORE] Classify throttle and internal errors as Retryable in Python #2914

Merged
merged 7 commits into from
Sep 25, 2024

Conversation

samster25
Copy link
Member

No description provided.

@github-actions github-actions bot added the chore label Sep 25, 2024
Copy link

codspeed-hq bot commented Sep 25, 2024

CodSpeed Performance Report

Merging #2914 will not alter performance

Comparing sammy/s3-retries (8560ec6) with main (45e2944)

Summary

✅ 17 untouched benchmarks

Copy link

codecov bot commented Sep 25, 2024

Codecov Report

Attention: Patch coverage is 20.51282% with 31 lines in your changes missing coverage. Please review.

Project coverage is 75.33%. Comparing base (d57433a) to head (8560ec6).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
src/daft-io/src/s3_like.rs 13.79% 25 Missing ⚠️
src/daft-io/src/lib.rs 0.00% 4 Missing ⚠️
src/common/error/src/python.rs 0.00% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main    #2914      +/-   ##
==========================================
- Coverage   78.34%   75.33%   -3.02%     
==========================================
  Files         596      596              
  Lines       69875    70952    +1077     
==========================================
- Hits        54747    53454    -1293     
- Misses      15128    17498    +2370     
Flag Coverage Δ
75.33% <20.51%> (-3.02%) ⬇️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
daft/exceptions.py 100.00% <100.00%> (ø)
src/common/error/src/error.rs 100.00% <ø> (ø)
src/common/error/src/python.rs 57.14% <0.00%> (-9.53%) ⬇️
src/daft-io/src/lib.rs 75.91% <0.00%> (-1.50%) ⬇️
src/daft-io/src/s3_like.rs 64.20% <13.79%> (-5.73%) ⬇️

... and 28 files with indirect coverage changes

"SlowDown",
"PriorRequestNotComplete",
"EC2ThrottledException",
];
Copy link
Contributor

Choose a reason for hiding this comment

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

Where did this come from? Should we document this list somehow

Copy link
Member Author

Choose a reason for hiding this comment

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

done

@@ -140,24 +159,33 @@ impl From<Error> for super::Error {
source: source.into(),
}
} else {
super::Error::UnableToOpenFile {
super::Error::MiscTransient {
Copy link
Contributor

Choose a reason for hiding this comment

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

Can we add some docs here making it explicit that this is an explicit decision to classify all other dispatch errors as "who knows what happened here, let's just tell the user it's transient"?

Comment on lines 266 to 281
err => match err.code() {
Some("InternalError") => super::Error::MiscTransient {
path,
source: err.into(),
},
Some(code) if THROTTLING_ERRORS.contains(&code) => {
super::Error::Throttled {
path,
source: err.into(),
}
}
_ => super::Error::Unhandled {
path,
msg: DisplayErrorContext(err).to_string(),
},
},
Copy link
Contributor

Choose a reason for hiding this comment

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

Seems like this group of logic is being repeated in 3 different places. Any chance that we could extract it into its own function?

Copy link
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Contributor

@raunakab raunakab left a comment

Choose a reason for hiding this comment

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

Just a minor comment, but looks good other than that.

@samster25 samster25 enabled auto-merge (squash) September 25, 2024 19:16
@samster25 samster25 merged commit a8602a2 into main Sep 25, 2024
37 of 40 checks passed
@samster25 samster25 deleted the sammy/s3-retries branch September 25, 2024 19:56
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.

3 participants