-
Notifications
You must be signed in to change notification settings - Fork 136
test: add option to track the statement that starts a transaction #763
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
Conversation
Codecov Report
@@ Coverage Diff @@
## master #763 +/- ##
=========================================
Coverage 84.99% 85.00%
+ Complexity 2562 2561 -1
=========================================
Files 143 143
Lines 13983 14007 +24
Branches 1335 1338 +3
=========================================
+ Hits 11885 11906 +21
- Misses 1537 1538 +1
- Partials 561 563 +2
Continue to review full report at Codecov.
|
| if (transactionIdFuture == null) { | ||
| transactionIdFuture = SettableApiFuture.create(); | ||
| if (trackTransactionStarter) { | ||
| transactionStarter = new Exception("Requesting new transaction"); |
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.
This will create an Exception with the call stack of the statement that should return a transaction id. We keep track of this to be able to include it in any exception that could be thrown by later statements that timeout while waiting for this transaction id.
| TransactionSelector.newBuilder().setId(tx.get()).build(); | ||
| if (trackTransactionStarter) { | ||
| TransactionSelector.newBuilder() | ||
| .setId(tx.get(waitForTransactionTimeoutMillis, TimeUnit.MILLISECONDS)) |
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.
Use a timeout if we are tracking the statement that should return a transaction id.
| + "See the suppressed exception for the stacktrace of the caller that should return a transaction", | ||
| e); | ||
| if (transactionStarter != null) { | ||
| se.addSuppressed(transactionStarter); |
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.
Include the stacktrace of the statement that should have returned the transaction in the exception that we are throwing.
This is an auto-generated regeneration of the .pb.go files by cloud.google.com/go/internal/gapicgen. Once this PR is submitted, genbot will update the corresponding PR to depend on the newer version of go-genproto, and assign reviewers. Whilst this or any regen PR is open in go-genproto, genbot will not create any more regeneration PRs. If all regen PRs are closed, gapicgen will create a new set of regeneration PRs once per night. If you have been assigned to review this PR, please: - Ensure that CI is passing. If it's failing, it requires your manual attention. - Approve and submit this PR if you believe it's ready to ship. That will prompt genbot to assign reviewers to the google-cloud-go PR. Corresponding google-cloud-go PR: googleapis/google-cloud-go#5671 Changes: fix(ruby): Update the google-cloud-dataplex-v1 dependency to version 0.2 PiperOrigin-RevId: 429404615 Source-Link: googleapis/googleapis@ab177dc docs(samples): include metadata file, add exclusions for samples to handwritten libraries PiperOrigin-RevId: 429395631 Source-Link: googleapis/googleapis@84594b3 build(pubsub): add flag to distinguish autogenerated libs with a handwritten layer PiperOrigin-RevId: 429391240 Source-Link: googleapis/googleapis@f1529c0 build: add flag to distinguish autogenerated libs with a handwritten layer PiperOrigin-RevId: 429391190 Source-Link: googleapis/googleapis@fb5fba4 fix(bigquery/storage)!: remove bigquery.readonly auth scope PiperOrigin-RevId: 429331987 Source-Link: googleapis/googleapis@4b2bd26 chore: regenerate API index Source-Link: googleapis/googleapis@e8fdeb9 feat(logging): Update Logging API with latest changes PiperOrigin-RevId: 429289471 Source-Link: googleapis/googleapis@acd5f89 docs: fix docstring formatting Committer: parthea PiperOrigin-RevId: 429178314 Source-Link: googleapis/googleapis@f30b83d
Adds an option to track the statement that starts a read/write transaction by inlining a
BeginTransactionoption with the request. This can be used to track down statements that do not return a transaction id in a timely fashon.