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

Ensure all failed transactions are rolled back. #118

Merged

Conversation

ericpromislow
Copy link
Contributor

Related to #46410

I only found one instance.

Basically any function that receives a transaction handle and returns a
non-nil error is responsible for ensuing the transaction is rolled back.
This is covered by any failed calls to tx.Exec or tx.StmtExec but
in this case ListOptionIndexer#afterUpsert can fail on other situations,
and is therefore responsible for rolling back the transaction.

maxsokolovsky and others added 2 commits November 8, 2024 16:57
There's only one remaining instance in lasso of a function that
takes an instance of `db.TXClient`, finds an error situation that
doesn't happen due to a database call (`Exec` or `ExecStmt`), and
doesn't rollback the transaction before returning a non-nil error.
@ericpromislow ericpromislow requested a review from a team as a code owner November 12, 2024 19:59
@ericpromislow ericpromislow self-assigned this Nov 12, 2024
@ericpromislow ericpromislow requested review from moio and a team and removed request for a team November 12, 2024 20:00
Copy link

@gehrkefc gehrkefc left a comment

Choose a reason for hiding this comment

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

LGTM

@ericpromislow ericpromislow merged commit cbc3210 into rancher:main Nov 15, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants