Skip to content

Check MongoException error labels for recoverable transaction errors [DATAMONGO-2073] #2939

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

Closed
spring-projects-issues opened this issue Aug 28, 2018 · 4 comments
Assignees
Labels
in: core Issues in core support type: task A general task

Comments

@spring-projects-issues
Copy link

Christoph Strobl opened DATAMONGO-2073 and commented

Check MongoException for lables TransientTransactionError, UnknownTransactionCommitResult indicating potentially recoverable transaction commit errors and translate them to TransientDataAccessException.

See MongoException#hasErrorLabel(String).


Issue Links:

  • DATAMONGO-2075 Open up MongoTransaction manager to allow transaction commit retry.

  • DATAMONGO-2291 MongoExceptionTranslator hides WriteConflicts

Referenced from: pull request #605

1 votes, 2 watchers

@spring-projects-issues
Copy link
Author

Christoph Strobl commented

Moved to backlog in favor of DATAMONGO-2075

@spring-projects-issues
Copy link
Author

Mark Baker-Munton commented

DATAMONGO-2075 doesn't solve the problem entirely as some transaction errors can be thrown prior to a transaction commit operation.

WriteConflicts are one example:

1. begin tx
2. update document y
3. commit tx 

If another thread/user modifies document y after beginning the transaction and before updating the document, an exception will be thrown on line 2 and not line 3

@WitekBaranowskiAllegro
Copy link

@christophstrobl do you have any plans to fix this issue?

@mp911de
Copy link
Member

mp911de commented Sep 4, 2024

We do not have means to represent the dimension of contextual transient exceptions. If we would wrap certain exceptions into a TransientException wrapper, then calling code would not be able to handle the actual exception type. Also, conditionally using a different exception type would introduce a different behavior potentially breaking existing application code.

As there is no other means of adding the information, we suggest using MongoExceptionTranslator.isTransientFailure.

@mp911de mp911de added this to the 4.4 M1 (2024.1.0) milestone Sep 4, 2024
mp911de pushed a commit that referenced this issue Sep 4, 2024
mp911de added a commit that referenced this issue Sep 4, 2024
Original pull request: #605
See #3148
See #2939
@mp911de mp911de closed this as completed Sep 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
in: core Issues in core support type: task A general task
Projects
None yet
Development

No branches or pull requests

4 participants