-
Notifications
You must be signed in to change notification settings - Fork 42
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
Wrap url.Error in APIError #722
Conversation
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #722 +/- ##
==========================================
- Coverage 16.85% 16.81% -0.05%
==========================================
Files 103 103
Lines 14109 14116 +7
==========================================
- Hits 2378 2373 -5
- Misses 11525 11535 +10
- Partials 206 208 +2 ☔ View full report in Codecov by Sentry. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Discussed in person and decided on treating url.Error
retries separately from apierr.APIError
retries, given the former are for lower level networking issues and the latter for when we actually got a response from the server.
870eac1
to
d38b784
Compare
@@ -65,16 +65,6 @@ func New(cfg *config.Config) (*DatabricksClient, error) { | |||
}, | |||
TransientErrors: []string{ | |||
"REQUEST_LIMIT_EXCEEDED", // This is temporary workaround for SCIM API returning 500. Remove when it's fixed |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looking at this sole example remaining, the field could be removed and folded into ErrorRetriable
as well. In this case in the set of transient errors in apierr
because it is SCIM related (can be another PR).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah. I will do that in another PR. I guess this is slightly more generic since it doesn't assume a specific structure of the response body, but I think it would still be OK to move to APIError.
Minor changes: * Support overriding DatabricksEnvironment ([#723](#723)). * Detect `Accept` header in `httpclient.WithResponseUnmarshal` ([#710](#710)). * Detect `Content-Type` header in `newRequestBody` for `httpclient` ([#711](#711)). Bug fixes: * Retry request on `REQUEST_LIMIT_EXCEEDED` error returned by the SCIM API ([#721](#721)). * Match retry logic of pre-refactor SDK ([#722](#722)).
Minor changes: * Support overriding DatabricksEnvironment ([#723](#723)). * Detect `Accept` header in `httpclient.WithResponseUnmarshal` ([#710](#710)). * Detect `Content-Type` header in `newRequestBody` for `httpclient` ([#711](#711)). Bug fixes: * Retry request on `REQUEST_LIMIT_EXCEEDED` error returned by the SCIM API ([#721](#721)). * Match retry logic of pre-refactor SDK ([#722](#722)).
Changes
b0f3c83 introduced a regression in the handling of errors returned from HttpClient.Do. Previously, only some errors returned by Client.Do() were retried; now, all are retried. This PR adds default error handling logic in httpclient for errors returned by Client.Do() matching the previous behavior. As part of this, we remove the duplicated transient error messages between apierr and the default client.
Tests
make test
passingmake fmt
applied