-
Notifications
You must be signed in to change notification settings - Fork 13
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
Make more error codes fail fast during the rediscovery #536
Merged
robsdedude
merged 3 commits into
neo4j-drivers:5.0
from
bigmontz:5.x-fast-failing-in-more-errors
Dec 6, 2022
Merged
Make more error codes fail fast during the rediscovery #536
robsdedude
merged 3 commits into
neo4j-drivers:5.0
from
bigmontz:5.x-fast-failing-in-more-errors
Dec 6, 2022
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(Most) drivers will try really hard to fetch a valid RT. This entails going to the next know router if the previous one failed. In this process many errors that are considered unrecoverable in the transaction context are considered retryable. However, a hand full of errors should not be retried to improve user experience. Namely those, that are caused by malformed user-input. Instead of asking all routers if they can make sense of it and ultimately failing with a generic routing update error, it's better to fail fast and give the raw error of the server to the user. Currently, these errors are - `Neo.ClientError.Database.DatabaseNotFound` - `Neo.ClientError.Transaction.InvalidBookmark` - `Neo.ClientError.Transaction.InvalidBookmarkMixture` Added two more: - `Neo.ClientError.Statement.ArgumentError`, which happens on failed attempts of impersonation (user or permissions missing) - `Neo.ClientError.Request.Invalid` which happens when trying things like impersonating an integer
This error occurs when try to use a number as database name in protocol versions which doesn't suport ROUTE message.
robsdedude
approved these changes
Nov 24, 2022
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
⚡
Co-authored-by: Robsdedude <dev@rouvenbauer.de>
injectives
added a commit
to injectives/neo4j-java-driver
that referenced
this pull request
Dec 14, 2022
injectives
added a commit
to neo4j/neo4j-java-driver
that referenced
this pull request
Dec 15, 2022
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
(Most) drivers will try really hard to fetch a valid RT. This entails going to the next know router if the previous one failed. In this process many errors that are considered unrecoverable in the transaction context are considered retryable. However, a hand full of errors should not be retried to improve user experience. Namely those, that are caused by malformed user-input. Instead of asking all routers if they can make sense of it and ultimately failing with a generic routing update error, it's better to fail fast and give the raw error of the server to the user.
Currently, these errors are
Neo.ClientError.Database.DatabaseNotFound
Neo.ClientError.Transaction.InvalidBookmark
Neo.ClientError.Transaction.InvalidBookmarkMixture
Added three more:
Neo.ClientError.Statement.ArgumentError
: this happens on failed attempts of impersonation (user or permissions missing)Neo.ClientError.Request.Invalid
: this happens when trying things like impersonating an integerNeo.ClientError.Statement.TypeError
: this happens when trying things like set a database as an integer in bolt implementation which doesn't supportROUTE