-
Notifications
You must be signed in to change notification settings - Fork 112
Open
Labels
api: spannerIssues related to the googleapis/nodejs-spanner API.Issues related to the googleapis/nodejs-spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Description
database.run(...) hangs for a few seconds when an invalid query is passed.
Environment details
- OS: M1 Mac
- Node.js version: 20.7.0
- npm version: 10.1.0
@google-cloud/spannerversion: ^7.5.0- spanner emulator version: 1.5.13
Steps to reproduce
I created minimum reproducible code: https://github.com/ikenox/nodejs-spanner-example/tree/hangs-with-invalid-query
git clone git@github.com:ikenox/nodejs-spanner-example.git
git checkout hangs-with-invalid-query
pnpm install
gcloud emulators spanner start &
SPANNER_EMULATOR_HOST=localhost:9010 pnpm exec ts-node src/main.tsmain.ts executes the code like below.
console.time('valid query');
await database.run('select 1');
console.timeEnd('valid query');
console.time('invalid query');
try{
await database.run('select aaa');
}catch(e){
console.log(e);
}
console.timeEnd('invalid query');And the output is below:
valid query: 21.579ms
3 INVALID_ARGUMENT: Unrecognized name: aaa [at 1:8]
select aaa
^
invalid query: 7.406s
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
api: spannerIssues related to the googleapis/nodejs-spanner API.Issues related to the googleapis/nodejs-spanner API.priority: p2Moderately-important priority. Fix may not be included in next release.Moderately-important priority. Fix may not be included in next release.type: bugError or flaw in code with unintended results or allowing sub-optimal usage patterns.Error or flaw in code with unintended results or allowing sub-optimal usage patterns.