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

Improve error reporting on routing discovery #870

Merged
merged 4 commits into from
Dec 8, 2022

Conversation

robsdedude
Copy link
Member

@robsdedude robsdedude commented Nov 29, 2022

Routing drivers (neo4j[+s[sc]]:// scheme) retry fetching a routing table on many different errors that are considered not retryable in the context of transactions. This is to overall improve the driver's stability when connecting to clusters.

However, this poses the risk of hiding user-input errors (e.g., selecting a database name that is invalid or doesn't exist). Hence, the driver blacklists a handful of selected error codes upon which the discovery process is terminated prematurely, raising the raw error to the user.

We expand the list to include more errors:

  • Neo.ClientError.Statement.TypeError, e.g., when trying to impersonate an integer.
  • Neo.ClientError.Statement.ArgumentError, e.g., when trying to impersonate without the required permissions.
  • Neo.ClientError.Request.Invalid, e.g., when trying to select an integer database.

Depends on

Routing drivers (`neo4j[+s[sc]]://` scheme) retry fetching a routing table on
many different errors that are considered not retryable in the context of
transactions. This is to overall improve the driver's stability when connecting
to clusters.

However, this poses the risk of hiding user-input errors (e.g., selecting a
database name that is invalid or doesn't exist). Hence, the driver blacklists a
handful of selected error codes upon which the discovery process is terminated
prematurely, raising the raw error to the user.

We expand the list to include more errors:
 * `Neo.ClientError.Statement.TypeError`, e.g., when  trying to impersonate an
   integer.
 * `Neo.ClientError.Statement.ArgumentError`, e.g., when trying to impersonate
   without the required permissions.
 * `Neo.ClientError.Request.Invalid`, e.g., when trying to select an integer
   database.
Copy link
Contributor

@bigmontz bigmontz left a comment

Choose a reason for hiding this comment

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

🍰

src/neo4j/exceptions.py Show resolved Hide resolved
Copy link
Contributor

@bigmontz bigmontz left a comment

Choose a reason for hiding this comment

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

🏃🏼

@robsdedude robsdedude merged commit d48907c into neo4j:5.0 Dec 8, 2022
@robsdedude robsdedude deleted the more-fast-failing-discovery branch December 8, 2022 11:11
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.

2 participants