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

transactions that aren't retried don't rollback #765

Closed
daniel-sanche opened this issue Sep 20, 2023 · 1 comment
Closed

transactions that aren't retried don't rollback #765

daniel-sanche opened this issue Sep 20, 2023 · 1 comment
Assignees
Labels
api: firestore Issues related to the googleapis/python-firestore API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.

Comments

@daniel-sanche
Copy link
Contributor

in Transaction.call, rollback is called when retries are exhausted, or when pre-commit fails, but other exceptions cause an immediate raise, without any rollback.

To fix this, the entire __call__ function should be wrapped in a try...except block, that causes a rollback before any exceptions are raised out of the transaction

@daniel-sanche daniel-sanche self-assigned this Sep 20, 2023
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/python-firestore API. label Sep 20, 2023
@daniel-sanche daniel-sanche added type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. priority: p2 Moderately-important priority. Fix may not be included in next release. and removed api: firestore Issues related to the googleapis/python-firestore API. labels Sep 20, 2023
@product-auto-label product-auto-label bot added the api: firestore Issues related to the googleapis/python-firestore API. label Sep 20, 2023
@kolea2
Copy link
Contributor

kolea2 commented Jan 10, 2024

It looks like this was fixed in #767, closing. @daniel-sanche please reopen if needed. Thanks!

@kolea2 kolea2 closed this as completed Jan 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api: firestore Issues related to the googleapis/python-firestore API. priority: p2 Moderately-important priority. Fix may not be included in next release. type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet
Development

No branches or pull requests

2 participants