Skip to content
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

Merged
merged 18 commits into from
Aug 31, 2018

Conversation

crwilcox
Copy link
Contributor

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.

@ghost ghost assigned crwilcox Aug 24, 2018
@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Aug 24, 2018
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.

@codecov
Copy link

codecov bot commented Aug 24, 2018

Codecov Report

Merging #309 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #309      +/-   ##
==========================================
+ Coverage   99.61%   99.61%   +<.01%     
==========================================
  Files          12       12              
  Lines        1294     1299       +5     
==========================================
+ Hits         1289     1294       +5     
  Misses          5        5
Impacted Files Coverage Δ
src/transaction.js 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update f92b224...a8ecec9. Read the comment docs.

@ghost ghost assigned JustinBeckwith Aug 27, 2018
Copy link
Contributor

@stephenplusplus stephenplusplus left a 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.

@codecov
Copy link

codecov bot commented Aug 29, 2018

Codecov Report

Merging #309 into master will increase coverage by <.01%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master     #309      +/-   ##
==========================================
+ Coverage   99.53%   99.53%   +<.01%     
==========================================
  Files          12       12              
  Lines        1278     1283       +5     
==========================================
+ Hits         1272     1277       +5     
  Misses          6        6
Impacted Files Coverage Δ
src/transaction.js 100% <100%> (ø) ⬆️
src/index.js 100% <0%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 751dfeb...eee5763. Read the comment docs.

code: 4,
message: 'Deadline for Transaction exceeded.',
});
let apiError = new common.util.ApiError(

This comment was marked as spam.

@crwilcox crwilcox changed the title wrap the inner error on retried transactions and return when deadline exceeded Minor: wrap the inner error on retried transactions and return when deadline exceeded Aug 29, 2018
@crwilcox crwilcox merged commit 29c51bd into master Aug 31, 2018
@jmdobry jmdobry deleted the maintain-inner-error-on-deadline branch October 16, 2018 19:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants