Database.runTransactionAsync should check that the error returned can be re-tried instead of the indefinite while(true) loop #2166
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.
If we examine the code for Database.runTransactionAsync, it invokes a while(true) loop retrying on any error without differentiating if the error can be retried or not and the only way to break out of that loop is by throwing an exception
nodejs-spanner/src/database.ts
Lines 3370 to 3406 in 2a19ef1
The only way I can test out functionality of that code in error is by throwing an exception and there aren't tests for what happens with a variety of errors. Let's please add them.
The text was updated successfully, but these errors were encountered: