-
Notifications
You must be signed in to change notification settings - Fork 3.1k
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
Retry Databricks query for 503 retry after without Retry-After
header
#14392
Conversation
// Databricks JDBC driver retries operations that receive HTTP 503 responses | ||
// if the server response is returned with Retry-After headers by default. | ||
// Following policy retries only once when received 'HTTP retry after response' without Retry-After headers. | ||
|
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.
remove this line so that the comment is close to the entity it documents
.handleIf(throwable -> throwable.getMessage().contains("HTTP Response code: 502")) | ||
.withBackoff(1, 10, ChronoUnit.SECONDS) | ||
.withMaxRetries(60) | ||
.onRetry(event -> log.warn(event.getLastFailure(), "Query failed on attempt %d, will retry.", event.getAttemptCount())); | ||
|
||
// Databricks JDBC driver retries operations that receive HTTP 503 responses | ||
// if the server response is returned with Retry-After headers by default. | ||
// Following policy retries only once when received 'HTTP retry after response' without Retry-After headers. |
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.
So we want to retry "even more" than the driver does by itself, right?
I.e. we retry on top of driver's retries?
- let's make it explicit in the comment
- is there a way to configure the driver to retry for a longer time than it does by default?
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.
JDBC driver wouldn't retry when the response doesn't have Retry-After headers. Added retry policy covers the situation.
We can increase TemporarilyUnavailableRetryTimeout
(900s by default) for failure having Retry-After headers. However, increasing the value won't resolve the recent flaky issue.
52a6757
to
db06e4c
Compare
// Databricks JDBC driver retries operations that receive HTTP 503 responses | ||
// if the server response is returned WITH Retry-After headers by default. | ||
// Following policy retries only once when received 'HTTP retry after response' WITHOUT Retry-After headers. | ||
RetryPolicy<QueryResult> databricks503RetryPolicy = new RetryPolicy<QueryResult>() |
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.
Did you happen to spot this issue several times in the builds?
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.
It seems retrying is not safe in case of write operations. The actual row count is double when retried
|
I will look for another solution as retrying for all 503 causes different issue. |
Description
Fixes #14391
Release notes
(x) This is not user-visible or docs only and no release notes are required.
( ) Release notes are required, please propose a release note for me.
( ) Release notes are required, with the following suggested text: