googleapis / nodejs-spanner

Node.js client for Google Cloud Spanner: the world’s first fully managed relational database service to offer both strong consistency and horizontal scalability.
https://cloud.google.com/spanner/
Apache License 2.0
135 stars 99 forks source link

fix: Retry with timeout #2071

Closed surbhigarg92 closed 2 months ago

surbhigarg92 commented 2 months ago

Use gaxOptions.timeout during retry in streaming calls. Earlier the timeout value was only used for a single RPC not for the whole operation including retries. Now if RPC returns Unavailable error and the timeout value has been reached, library will throw an Deadline exceeded error.

const query = {
        sql: 'Select 1',
        gaxOptions: {timeout: 500}
    }
const [rows] = await database.run(query);
generated-files-bot[bot] commented 2 months ago

Warning: This pull request is touching the following templated files:

snippet-bot[bot] commented 2 months ago

No region tags are edited in this PR.

This comment is generated by snippet-bot. If you find problems with this result, please file an issue at: https://github.com/googleapis/repo-automation-bots/issues. To update this comment, add snippet-bot:force-run label or use the checkbox below: