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

RetryExceptionPredicate has the wrong error messages #2944

Closed
GregDThomas opened this issue Aug 27, 2024 · 4 comments
Closed

RetryExceptionPredicate has the wrong error messages #2944

GregDThomas opened this issue Aug 27, 2024 · 4 comments
Assignees
Labels
type: bug A general bug

Comments

@GregDThomas
Copy link
Contributor

org.springframework.data.neo4j.core.support.RetryExceptionPredicate contains two exception messages that are retryable;

private static final Set<String> RETRYABLE_ILLEGAL_STATE_MESSAGES = Set.of(
			"Transaction must be open, but has already been closed.",
			"Session must be open, but has already been closed.");

Neither of these messages appear anywhere in the code base. However, very similar messages (without a trailing dot) appear in exceptions raised in org.springframework.data.neo4j.core.transaction.Neo4jTransactionHolder. Given these exceptions should be retryable, these exception messages should match.

(Background; we've been wondering why some exceptions weren't being retried in our code base - finally narrowed it down to this!)

@michael-simons michael-simons self-assigned this Aug 27, 2024
@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Aug 27, 2024
GregDThomas added a commit to GregDThomas/spring-data-neo4j that referenced this issue Aug 27, 2024
@michael-simons
Copy link
Collaborator

Excellent catch! Gonna run your build quickly, then merge it.

The background here: A while back, it was agreed Spring wide that trailing dots in exception messages should be removed.
Well, that's what I get for not having constants for that in the first place. Thank you!

@GregDThomas
Copy link
Contributor Author

I'm guessing this could/should be backported to 7.3.x, maybe 7.2.x depending on when the change was made?

@michael-simons
Copy link
Collaborator

I will take care of this for all supported branches. :)

@michael-simons michael-simons added type: bug A general bug and removed status: waiting-for-triage An issue we've not yet triaged labels Aug 27, 2024
michael-simons pushed a commit that referenced this issue Aug 27, 2024
This fix #2944 by making the retryable exception messages consistent by introducing constants for prematurely closed transactions and sessions omitting the trailing dot as agreed within the bigger Spring Data team.
michael-simons pushed a commit that referenced this issue Aug 27, 2024
This fix #2944 by making the retryable exception messages consistent by introducing constants for prematurely closed transactions and sessions omitting the trailing dot as agreed within the bigger Spring Data team.
@GregDThomas
Copy link
Contributor Author

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type: bug A general bug
Projects
None yet
Development

No branches or pull requests

3 participants