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(client): Add timeout and connect error to backoff transient error #1014

Merged
merged 6 commits into from
Apr 5, 2022
Merged

feat(client): Add timeout and connect error to backoff transient error #1014

merged 6 commits into from
Apr 5, 2022

Conversation

ptondereau
Copy link
Contributor

@ptondereau ptondereau commented Feb 18, 2022

#790

I think I could make it, but I don't know how to test with httpmock a connect error.
I turned 400's errors into a transient error, but I could revert this, if you want.
Configuration with CLI argument should be done in another PR.
Inspiration: https://github.com/TrueLayer/reqwest-middleware/blob/main/reqwest-retry/src/retryable.rs

@ptondereau ptondereau marked this pull request as ready for review February 23, 2022 20:25
@EverlastingBugstopper
Copy link
Contributor

@ptondereau thanks for working on this. We're in the midst of some work on federation at the moment so I don't have time to review this right this moment but rest assured I will not forget! Thanks for your patience.

@@ -166,6 +197,22 @@ fn handle_graphql_body_errors(errors: Vec<GraphQLError>) -> Result<(), RoverClie
}
}

/// Downcasts the given err source into T.
fn get_source_error_type<T: std::error::Error + 'static>(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

this hack because waiting for hyperium/hyper#2711

@netlify
Copy link

netlify bot commented Mar 23, 2022

👷 Deploy request for apollo-cli-docs pending review.

Visit the deploys page to approve it

Name Link
🔨 Latest commit 57327e8

Copy link
Contributor

@EverlastingBugstopper EverlastingBugstopper left a comment

Choose a reason for hiding this comment

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

@ptondereau thanks so much for your patience on this. This looks great! We'll get it in for the next release

@EverlastingBugstopper EverlastingBugstopper merged commit 56662e2 into apollographql:main Apr 5, 2022
@EverlastingBugstopper EverlastingBugstopper added this to the 0.5.0 milestone Apr 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants