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

fix: Always set the retry attempt to 0 for now #1251

Conversation

danieljbruce
Copy link
Contributor

If the retry attempt is greater than 1 then a library called retryRequest creates a large delay. If we force the retry count to be 0 then we skip this delay and the requests run in the required timeline.

If the retry attempt is greater than 1 then a library called retryRequest creates a large delay. If we force the retry count to be 0 then we skip this delay and the requests run in the required timeline.
@product-auto-label product-auto-label bot added size: xs Pull request size is extra small. api: bigtable Issues related to the googleapis/nodejs-bigtable API. labels Mar 13, 2023
@danieljbruce danieljbruce marked this pull request as ready for review March 13, 2023 19:09
@danieljbruce danieljbruce requested review from a team as code owners March 13, 2023 19:09
@danieljbruce danieljbruce changed the title Always set the retry attempt to 0 for now fix: Always set the retry attempt to 0 for now Mar 13, 2023
@@ -776,7 +776,7 @@ Please use the format 'prezzy' or '${instance.name}/tables/prezzy'.`);
} as google.bigtable.v2.IReadRowsRequest;

const retryOpts = {
currentRetryAttempt: numConsecutiveErrors,
currentRetryAttempt: 0, // was numConsecutiveErrors
Copy link
Contributor

Choose a reason for hiding this comment

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

Do you know why "numConsecutiveErrors" doesn't work here even though its value is 0 according to Line 730?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

numConsecutiveErrors works, but if it is greater than 0 then that will make the request take longer. Note that the number of consecutive errors is incremented at

numConsecutiveErrors++;
on each retry.

Copy link
Contributor

Choose a reason for hiding this comment

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

I found this

calculatedNextRetryDelay = config.initialRetryDelayMillis * Math.pow(config.retryDelayMultiplier, numConsecutiveErrors)

It implies that when it's executed for the first time (i.e. the original request has failure), numConsecutiveErrors should be 0 such that the retry delay is config.initialRetryDelayMillis

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Keep in mind that the change in the PR doesn't affect this code. This is a delay that happens in the veneer layer while the delay in retryRequest happens below the veneer layer.

@@ -776,7 +776,7 @@ Please use the format 'prezzy' or '${instance.name}/tables/prezzy'.`);
} as google.bigtable.v2.IReadRowsRequest;

const retryOpts = {
currentRetryAttempt: numConsecutiveErrors,
currentRetryAttempt: 0, // was numConsecutiveErrors
Copy link
Contributor

Choose a reason for hiding this comment

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

I found this

calculatedNextRetryDelay = config.initialRetryDelayMillis * Math.pow(config.retryDelayMultiplier, numConsecutiveErrors)

It implies that when it's executed for the first time (i.e. the original request has failure), numConsecutiveErrors should be 0 such that the retry delay is config.initialRetryDelayMillis

@danieljbruce danieljbruce added the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 15, 2023
@gcf-owl-bot gcf-owl-bot bot removed the owlbot:run Add this label to trigger the Owlbot post processor. label Mar 15, 2023
@danieljbruce danieljbruce merged commit 5ee6f19 into googleapis:main Mar 15, 2023
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: bigtable Issues related to the googleapis/nodejs-bigtable API. size: xs Pull request size is extra small.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants