Skip to content

fix: filterOptions errors cause transaction to abort - #5079

Merged
denolfe merged 5 commits into
mainfrom
fix/#4350-transaction-aborted-to-aborted
Feb 16, 2024
Merged

denolfe merged 5 commits into
mainfrom
fix/#4350-transaction-aborted-to-aborted

Conversation

@DanRibbens

Copy link
Copy Markdown
Contributor

Description

fix #4350

  • fix(db-mongodb): uncaught abortTransaction race condition

  • fix: filterOptions errors cause transaction to abort

  • I have read and understand the CONTRIBUTING.md document in this repository.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Checklist:

  • Existing test suite passes locally with my changes

@denolfe
denolfe merged commit 5f3d016 into main Feb 16, 2024
@denolfe
denolfe deleted the fix/#4350-transaction-aborted-to-aborted branch February 16, 2024 18:33

@BrianJM BrianJM left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Should the session be closed if the transaction cannot be aborted?

await this.sessions[id].abortTransaction()
await this.sessions[id].endSession()
} catch (error) {
// ignore the error as it is likely a race condition from multiple errors

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

await this.sessions[id].endSession() may need to be in the catch block.

@DanRibbens DanRibbens Feb 23, 2024 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

You might be right about this, if the abortTransaction errors endSession won't be called.

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.

v2.3.0 causes mongo transaction issue "Attempted illegal state transition from [TRANSACTION_ABORTED] to [TRANSACTION_ABORTED]"

3 participants