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

fix: mark transaction as invalid if no tx is returned before close #791

Merged
merged 1 commit into from Jan 12, 2021

Conversation

olavloite
Copy link
Collaborator

If a query requests the begin of a new transaction, the transaction id is returned by the first call to ResultSet#next(). If the ResultSet is closed by another thread before the first result has been returned, or before that result has been consumed internally to set the transaction id, no transaction id will be set. This will cause any subsequent statement in the same transaction
to timeout while waiting for a transaction to be returned.

…osed

If a query requests the begin of a new transaction, the transaction id is
returned by the first call to ResultSet#next(). If the ResultSet is closed
by another thread before the first result has been returned, or before that
result has been consumed internally to set the transaction id, no transaction
id will be set. This will cause any subsequent statement in the same transaction
to timeout while waiting for a transaction to be returned.
@olavloite olavloite requested a review from a team as a code owner January 11, 2021 13:47
@google-cla google-cla bot added the cla: yes This human has signed the Contributor License Agreement. label Jan 11, 2021
@product-auto-label product-auto-label bot added the api: spanner Issues related to the googleapis/java-spanner API. label Jan 11, 2021
@codecov
Copy link

codecov bot commented Jan 11, 2021

Codecov Report

Merging #791 (9500114) into master (3f28c46) will increase coverage by 0.00%.
The diff coverage is 78.57%.

Impacted file tree graph

@@            Coverage Diff            @@
##             master     #791   +/-   ##
=========================================
  Coverage     85.01%   85.01%           
- Complexity     2561     2562    +1     
=========================================
  Files           143      143           
  Lines         14005    14015   +10     
  Branches       1337     1341    +4     
=========================================
+ Hits          11906    11915    +9     
  Misses         1537     1537           
- Partials        562      563    +1     
Impacted Files Coverage Δ Complexity Δ
...va/com/google/cloud/spanner/AbstractResultSet.java 83.27% <75.00%> (-0.22%) 28.00 <0.00> (ø)
...om/google/cloud/spanner/TransactionRunnerImpl.java 84.86% <80.00%> (+0.16%) 9.00 <0.00> (ø)
.../com/google/cloud/spanner/AbstractReadContext.java 87.07% <100.00%> (+0.30%) 48.00 <1.00> (+1.00)

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 3f28c46...9500114. Read the comment docs.

Copy link
Contributor

@thiagotnunes thiagotnunes left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks so much for fixing this!

@thiagotnunes thiagotnunes merged commit e02e5a7 into master Jan 12, 2021
@thiagotnunes thiagotnunes deleted the mark-invalid-on-close branch January 12, 2021 02:10
thiagotnunes pushed a commit that referenced this pull request May 6, 2021
…osed (#791)

If a query requests the begin of a new transaction, the transaction id is returned by the first call to ResultSet#next(). If the ResultSet is closed by another thread before the first result has been returned, or before that result has been consumed internally to set the transaction id, no transaction id will be set. This will cause any subsequent statement in the same transaction to timeout while waiting for a transaction to be returned.
ansh0l pushed a commit to ansh0l/java-spanner that referenced this pull request Nov 10, 2022
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#5865

Changes:

chore: regenerate API index

  Source-Link: googleapis/googleapis@0db710b

feat(securitycenter): Add iam_binding field to findings attributes. It represents particular IAM bindings, which captures a member's role addition, removal, or state
  PiperOrigin-RevId: 439976914
  Source-Link: googleapis/googleapis@f83787e

docs: explicitly document empty list and search responses
  PiperOrigin-RevId: 439957204
  Source-Link: googleapis/googleapis@fef35d4

chore(dialogflow/cx): remove unused imports
  PiperOrigin-RevId: 439948451
  Source-Link: googleapis/googleapis@1a8770e

feat(compute): update compute API to revision 20220322 (googleapis#710)

  Source-Link: googleapis/googleapis@68ad73b

chore: Update disco-to-proto3-converter
  PiperOrigin-RevId: 439885092
  Source-Link: googleapis/googleapis@6d0a5db

docs(bigquery/reservation): Mark v1beta1 API as deprecated
  PiperOrigin-RevId: 439847134
  Source-Link: googleapis/googleapis@3255022

chore: regenerate API index

  Source-Link: googleapis/googleapis@98a98fa

chore: remove unused imports
  PiperOrigin-RevId: 439804516
  Source-Link: googleapis/googleapis@ef938a4
rajatbhatta pushed a commit to rajatbhatta/java-spanner that referenced this pull request Nov 17, 2022
🤖 I have created a release *beep* *boop*
---


### [2.6.3](googleapis/java-spanner-jdbc@v2.6.2...v2.6.3) (2022-03-29)


### Dependencies

* update dependency com.google.cloud:google-cloud-shared-dependencies to v2.9.0 ([googleapis#789](googleapis/java-spanner-jdbc#789)) ([5fd7287](googleapis/java-spanner-jdbc@5fd7287))

---
This PR was generated with [Release Please](https://github.com/googleapis/release-please). See [documentation](https://github.com/googleapis/release-please#release-please).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: spanner Issues related to the googleapis/java-spanner API. cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants