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 fatal error propagation in commit & rollback #484

Merged
merged 6 commits into from
Apr 13, 2018

Conversation

lutovich
Copy link
Contributor

@lutovich lutovich commented Apr 9, 2018

No description provided.

When establishing connection it was possible for `IOException` to get
propagated directly to the user without being wrapped in a
`ServiceUnavailableException`. This happened because `HandshakeHandler`
only wrapped security-related exceptions with driver exceptions. It was
problematic because rest of the codebase expects to deal with
`ServiceUnavailableException`s. For example rediscovery and retries
code can deal nicely with `ServiceUnavailableException`.

This commit fixes the problem by making `HandshakeHandler` wrap all
non-security related exceptions in `ServiceUnavailableException`.
Fatal errors terminate the transaction. It will fail to commit when
terminated and rollback will be a no-op. All outstanding errors from
previous queries should still be propagated.

Previously transaction checked it's terminated status too early and
sometimes did not propagate pending errors. This commit fixes the
problem by moving the termination check to a place where all result
cursors are fully fetched. So errors from cursors will always get
propagated.

Also added a constant for default `RoutingSettings` for convenience.
Copy link
Contributor

@ali-ince ali-ince left a comment

Choose a reason for hiding this comment

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

LGTM!

@ali-ince
Copy link
Contributor

@lutovich waiting for the tests to go green before merging.

Use direct drivers to fetch cluster overview from cores, instead of
routing driver and write session. Wait for at most 60 seconds.
@lutovich lutovich merged commit ef48d78 into neo4j:1.5 Apr 13, 2018
@lutovich lutovich deleted the 1.5-tx-conn-error branch April 13, 2018 16:08
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