Uncaught exception with concurrent queries and inline begin #1972
Labels
api: spanner
Issues related to the googleapis/nodejs-spanner API.
priority: p2
Moderately-important priority. Fix may not be included in next release.
type: bug
Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
The client throws an unhandled exception if the initial queries in the transaction are called concurrently and one of the queries fails(except for the first one). You can see the example below. The issue is resolved if
transaction.begin()
is called explicitly before the concurrent queries.Environment details
@google-cloud/spanner
version: reproducible on masterSteps to reproduce
Minimal repro
This code will result in an uncaught exception and it will crash node process.
I think the issue is a missing error handler in this code.
nodejs-spanner/src/transaction.ts
Lines 1336 to 1338 in 6c0eef1
Adding this handler fixes the issue
Happy to open PR with test if this seems correct
The text was updated successfully, but these errors were encountered: