FazBrowse GitHub Viewer | Trending |
URL:
| Home
Tools: [Download Repo ZIP]   [Original HTTPS Page]

[PECO-1259] Implement retry behavior for CloudFetch by kravets-levko · Pull Request #211 · databricks/databricks-sql-nodejs · GitHub

[PECO-1259] Implement retry behavior for CloudFetch - #211

Merged
kravets-levko merged 4 commits into
mainfrom
PECO-1259-retry-policy
Jan 17, 2024
Merged

[PECO-1259] Implement retry behavior for CloudFetch#211
kravets-levko merged 4 commits into
mainfrom
PECO-1259-retry-policy

Conversation

kravets-levko commented Dec 11, 2023
edited by atlassian Bot
Loading

Copy link
Copy Markdown
Contributor

Signed-off-by: Levko Kravets <levko.ne@gmail.com>
Signed-off-by: Levko Kravets <levko.ne@gmail.com>

This comment was marked as outdated.

susodapop left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Left a couple comments.


// Delay interval depends on current attempt - the more attempts we do
// the longer the interval will be
// TODO: Respect `Retry-After` header (PECO-729)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yep, this is important. When the server responds with 429 or 503 it includes a Retry-After header that we should monitor.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Yes, that's why we have PECO-729. This PR (and this particular code) is almost untouched, just moved to a different place so it could be used for cloudfetch. After we merge this, I'm going to make it match PySQL's behavior, as you mentioned in your other comment below

// TODO: Respect `Retry-After` header (PECO-729)
const retryDelay = getRetryDelay(this.attempt, clientConfig);

const attemptsExceeded = this.attempt >= clientConfig.retryMaxAttempts;

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Nit: I think you can bump this logic up a few lines. If we already exceeded the maximum number of attempts there's no reason to get the retry delay.


return { shouldRetry: true, retryAfter: retryDelay };

// TODO: Here we should handle other error types (see PECO-730)

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality


const command = new CustomCommand(
new ThriftClientMock(() => {
new ThriftClientMock(context, () => {

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Do you have an integration test that verifies when requests are retried?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Not yet, but I'm going to add some after implementing PECO-729 (which should wrap up the whole retry feature)

susodapop left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Choose a reason Spam Abuse Off Topic Outdated Duplicate Resolved Low Quality

Approving as this is a strict refactor. Improvements to come in a subsequent PR.

kravets-levko merged commit a4e4aa7 into main Jan 17, 2024
kravets-levko deleted the PECO-1259-retry-policy branch January 17, 2024 19:01
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode characters
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.

3 participants


Back | FazBrowse Home | New Git URL