fix: increment seqno before execute calls to prevent InvalidArgument … by larkee · Pull Request #19 · googleapis/python-spanner · GitHub
Skip to content
This repository was archived by the owner on Jun 8, 2026. It is now read-only.

fix: increment seqno before execute calls to prevent InvalidArgument …#19

Merged
larkee merged 9 commits into
googleapis:masterfrom
larkee:seqno_bug_fix
Mar 24, 2020
Merged

fix: increment seqno before execute calls to prevent InvalidArgument …#19
larkee merged 9 commits into
googleapis:masterfrom
larkee:seqno_bug_fix

Conversation

@larkee

@larkee larkee commented Feb 18, 2020

Copy link
Copy Markdown
Contributor

…errors after a previous error

Fixes #11

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Feb 18, 2020
@larkee larkee requested review from crwilcox and tseaver February 18, 2020 05:54

@tseaver tseaver left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

In addition to the atomicity changes I suggested, the PR really needs to add a unit test for each modified method, provoking the bug (e.g., by raising an exception from inside the api.execute_streaming_sql / api.execute_sql / api.batch_execute_dml methods). The new testcases should then assert that the instance's _execute_sql_count had been incremented.

Comment thread google/cloud/spanner_v1/transaction.py Outdated
Comment thread google/cloud/spanner_v1/transaction.py Outdated

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Likewise here:

        seqno, self._execute_sql_count = self._execute_sql_count, self._execute_sql_count + 1

@googlebot

Copy link
Copy Markdown

We found a Contributor License Agreement for you (the sender of this pull request), but were unable to find agreements for all the commit author(s) or Co-authors. If you authored these, maybe you used a different email address in the git commits than was used to sign the CLA (login here to double check)? If these were authored by someone else, then they will need to sign a CLA as well, and confirm that they're okay with these being contributed to Google.
In order to pass this check, please resolve this problem and then comment @googlebot I fixed it.. If the bot doesn't comment, it means it doesn't think anything has changed.

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: no This human has *not* signed the Contributor License Agreement. and removed cla: yes This human has signed the Contributor License Agreement. labels Feb 20, 2020
@larkee larkee requested a review from tseaver February 21, 2020 04:53
@tseaver

tseaver commented Feb 25, 2020

Copy link
Copy Markdown
Contributor

@larkee I don't know what the CLA bot is on about: tseaver@palladion.com is my normal github email, and the one associated with my long-ago-signed CLA (I've been committing to these repos using it for 5+ years now!).

@tseaver

tseaver commented Feb 25, 2020

Copy link
Copy Markdown
Contributor

Also, the PR still needs the added unit tests I outlined above.

@googlebot

Copy link
Copy Markdown

CLAs look good, thanks!

ℹ️ Googlers: Go here for more info.

@googlebot googlebot added cla: yes This human has signed the Contributor License Agreement. and removed cla: no This human has *not* signed the Contributor License Agreement. labels Feb 26, 2020
@larkee

larkee commented Feb 27, 2020

Copy link
Copy Markdown
Contributor Author

@tseaver I've fixed the CLA problem by just redoing the commits. I added the test and noticed that the change to snapshot.py doesn't actually make any difference, possibly because the call is wrapped in functools.partial? Because of this, I've reverted it.

@odeke-em

odeke-em commented Mar 3, 2020

Copy link
Copy Markdown
Contributor

@larkee larkee requested a review from skuruppu March 23, 2020 06:09
@larkee larkee dismissed tseaver’s stale review March 24, 2020 04:25

I have made these changes.

@larkee larkee merged commit adeacee into googleapis:master Mar 24, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

cla: yes This human has signed the Contributor License Agreement.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

spanner: InvalidArgument: 400 Previously received a different request with this seqno. seqno=4 with no concurrency applied

5 participants