Skip to content

Commit

Permalink
Revert "fix: Remove custom readrows retry logic and rely on gax for r…
Browse files Browse the repository at this point in the history
…etries" (#1434)

* Revert "fix: Remove custom readrows retry logic and rely on gax for retries (…"

This reverts commit 3e0a46e.

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

* 🦉 Updates from OwlBot post-processor

See https://github.com/googleapis/repo-automation-bots/blob/main/packages/owl-bot/README.md

---------

Co-authored-by: Owl Bot <gcf-owl-bot[bot]@users.noreply.github.com>
  • Loading branch information
danieljbruce and gcf-owl-bot[bot] authored Jul 3, 2024
1 parent 3e0a46e commit c86d456
Show file tree
Hide file tree
Showing 12 changed files with 732 additions and 1,520 deletions.
18 changes: 13 additions & 5 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -69,6 +69,7 @@ export interface RequestOptions {
| 'BigtableTableAdminClient'
| 'BigtableClient';
reqOpts?: {};
retryOpts?: {};
gaxOpts?: {};
method?: string;
}
Expand Down Expand Up @@ -444,11 +445,6 @@ export class Bigtable {
{},
baseOptions,
{
// Setting gaxServerStreamingRetries to true ensures that for readrows,
// sampleRowKeys, mutateRows, generateInitialChangeStreamPartitions and
// readChangeStream calls in the data client that the new streaming
// retries functionality will be used.
gaxServerStreamingRetries: true,
servicePath: customEndpointBaseUrl || defaultBaseUrl,
'grpc.callInvocationTransformer': grpcGcp.gcpCallInvocationTransformer,
'grpc.channelFactoryOverride': grpcGcp.gcpChannelFactoryOverride,
Expand Down Expand Up @@ -850,6 +846,18 @@ export class Bigtable {
}

function makeRequestStream() {
const retryRequestOptions = Object.assign(
{
currentRetryAttempt: 0,
noResponseRetries: 0,
objectMode: true,
},
config.retryOpts
);

config.gaxOpts = Object.assign(config.gaxOpts || {}, {
retryRequestOptions,
});
prepareGaxRequest((err, requestFn) => {
if (err) {
stream.destroy(err);
Expand Down
Loading

0 comments on commit c86d456

Please sign in to comment.