-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Minor: wrap the inner error on retried transactions and return when deadline exceeded #309
Conversation
package.json
Outdated
@@ -64,6 +64,7 @@ | |||
"ycsb": "node ./benchmark/ycsb.js run -P ./benchmark/workloada -p table=usertable -p cloudspanner.instance=ycsb-instance -p operationcount=100 -p cloudspanner.database=ycsb" | |||
}, | |||
"dependencies": { | |||
"@google-cloud/common": "^0.23.0", |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
Codecov Report
@@ Coverage Diff @@
## master #309 +/- ##
==========================================
+ Coverage 99.61% 99.61% +<.01%
==========================================
Files 12 12
Lines 1294 1299 +5
==========================================
+ Hits 1289 1294 +5
Misses 5 5
Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, only one thought to add to the tests, if it's not too much trouble.
const formattedError = Transaction.createDeadlineError_(originalError); | ||
|
||
assert.deepStrictEqual(expectedError, formattedError); | ||
assert.strictEqual(formattedError.code, 4); |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…pis/nodejs-spanner into maintain-inner-error-on-deadline
Codecov Report
@@ Coverage Diff @@
## master #309 +/- ##
==========================================
+ Coverage 99.53% 99.53% +<.01%
==========================================
Files 12 12
Lines 1278 1283 +5
==========================================
+ Hits 1272 1277 +5
Misses 6 6
Continue to review full report at Codecov.
|
…pis/nodejs-spanner into maintain-inner-error-on-deadline
src/transaction.js
Outdated
code: 4, | ||
message: 'Deadline for Transaction exceeded.', | ||
}); | ||
let apiError = new common.util.ApiError( |
This comment was marked as spam.
This comment was marked as spam.
Sorry, something went wrong.
…pis/nodejs-spanner into maintain-inner-error-on-deadline
Addresses some of the concerns from #216. When a transaction is retired beyond the allowed timeout the inner error is lost. This change holds the inner error.