Skip to content

Routing driver forgets addresses on some errors - #176

Merged
praveenag merged 3 commits into
neo4j:1.5from
lutovich:1.5-forget-addresses-on-errors
Aug 23, 2017
Merged

Routing driver forgets addresses on some errors#176
praveenag merged 3 commits into
neo4j:1.5from
lutovich:1.5-forget-addresses-on-errors

Conversation

@lutovich

Copy link
Copy Markdown
Contributor

This PR makes routing driver forget addresses and purge their connections on network and database errors. It also makes driver forget write server addresses when they fail as writers, connections remain in the pool because such machines can remain readers/routers.

@lutovich
lutovich requested a review from technige July 20, 2017 22:34
@zhenlineo

Copy link
Copy Markdown
Contributor

LGTM. CC @technige

@technige technige left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Not keen on the error_handler changes to connection.py. It's quite unusual to dynamically attach methods in this way and the new try...except blocks catch all Exception types, which is generally considered too brute force.

I'm happy to pair on this.

@lutovich

lutovich commented Aug 4, 2017

Copy link
Copy Markdown
Contributor Author

@technige dynamic error_handler is now replaced by constructor injection of ConnectionErrorHandler. Later is different for direct and routing driver.

This commit makes routing driver forget addresses and purge their
connections on network and database errors. It also makes driver
forget write server addresses when they fail as writers, connections
remain in the pool because such machines can remain readers/routers.
To avoid comparing strings when handling routing errors.
Connection now takes a dedicated error handler object in constructor
instead of having one dynamically attached after creation.
@lutovich
lutovich force-pushed the 1.5-forget-addresses-on-errors branch from 32274af to 9edcf42 Compare August 23, 2017 08:31
@praveenag
praveenag merged commit ffcc17c into neo4j:1.5 Aug 23, 2017
@lutovich
lutovich deleted the 1.5-forget-addresses-on-errors branch August 25, 2017 10:18
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.

4 participants