-
Notifications
You must be signed in to change notification settings - Fork 98
feat: Fixing and refactoring transaction retry logic in dbapi. Also adding interceptors support for testing #1056
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
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.
Would you mind adding a description to the PR what the faulty behavior was that you found, and how you fixed it? The PR is relatively big and complex, so it would be good to have some context.
Also: After an initial pass, it is very clear that this feature does not have a good enough test coverage. There are some big problems with the current implementation (probably much of it was already there), and the fact that none of the tests have caught that is a clear sign that it is not tested well enough.
72ec835
to
5e013ca
Compare
My general impression is that we need a more extensive test suite for transaction retries. Tests that I would like to see are:
|
Thanks for spending time and figuring out all tests missing here. As discussed created a bug https://buganizer.corp.google.com/issues/319404848 for this |
…dding interceptors support for testing
… the statements details added for retry
…ws update count for batch dml in cursor
Thanks for your patience and perseverance on this 👍 |
We found couple of bugs in the existing retry logic, the major one being b/315807641
Other one being assuming tuple to be a list (line 316 in old connection.py) and comparing which would never work.
These issues were not caught as there are no proper tests for these.
So this PR is fixing those issues. Also the current code was not very easy to understand so this PR also refactor the retry logic from connection.py to transaction_helper.py along with the fixes. Tests from test_connection.py have also moved to test_transaction_helper.py along with many new tests (mainly on batch statements) added
Also added interceptors support so we can test retry logic in system tests. Added system tests for the same