镜像站点 · 本页由第三方 GitHub 只读镜像提供,非 GitHub 官方站点,不接受任何登录或凭据输入。前往 github.com
Skip to content

Readrows gapic layer with mock server - #1

Draft
danieljbruce wants to merge 7 commits into
createreadstream-with-mock-serverfrom
readrows-gapic-layer-with-mock-server
Draft

danieljbruce wants to merge 7 commits into
createreadstream-with-mock-serverfrom
readrows-gapic-layer-with-mock-server

Conversation

@danieljbruce

Copy link
Copy Markdown
Owner

This PR is not meant to be merged, just posted for debugging. A diff in this PR is shown against the branch that has the mock server set up for testing retries. This diff shows the new test which tests retries against the Gapic layer, ignoring the handwritten layer entirely which will be useful for isolating problems. Also, it sets server streaming retries to true in the gapic layer.

One possible strategy for isolating problems is to modify the const options: CallOptions = { line passing retry options directly into a call to the Gapic layer.

Comment thread system-test/read-rows.ts
Comment on lines +353 to +369
const backOffSettings = {
initialRetryDelayMillis: 10,
retryDelayMultiplier: 2,
maxRetryDelayMillis: 60000,
};
const shouldRetryFn = function checkRetry(error: GoogleError) {
return false; // return [14, 4].includes(error!.code!);
};
const retry = new RetryOptions([], backOffSettings, shouldRetryFn);
const options: CallOptions = {
otherArgs: {
header: {
'bigtable-attempt': 0,
},
},
retry,
maxRetries: 3,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
const backOffSettings = {
initialRetryDelayMillis: 10,
retryDelayMultiplier: 2,
maxRetryDelayMillis: 60000,
};
const shouldRetryFn = function checkRetry(error: GoogleError) {
return false; // return [14, 4].includes(error!.code!);
};
const retry = new RetryOptions([], backOffSettings, shouldRetryFn);
const options: CallOptions = {
otherArgs: {
header: {
'bigtable-attempt': 0,
},
},
retry,
maxRetries: 3,
const backOffSettings = {
initialRetryDelayMillis: 10,
retryDelayMultiplier: 2,
maxRetryDelayMillis: 60000,
maxRetries: 3
};
const shouldRetryFn = function checkRetry(error: GoogleError) {
return false; // return [14, 4].includes(error!.code!);
};
const retry = new RetryOptions([], backOffSettings, shouldRetryFn);
const options: CallOptions = {
otherArgs: {
header: {
'bigtable-attempt': 0,
},
},
retry,

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

this looks uglier than it is - it just moves maxRetries to the backoffSettings

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