Skip to content

Try all routers before giving up #529

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

Closed
wants to merge 1 commit into from

Conversation

robsdedude
Copy link
Member

When attempting to fetch a routing table, the driver shouldn't give up if the first attempt fails but other routers are known.

Remark: we could still do better, but this would require a huge rewrite and might introduce breaking changes.
If a custom resolver function return multiple addresses, the driver will only attempt to fetch a RT from the first server that yields a successful handshake. If that server fails to provide a valid RT for whatever reason, the driver will move on to the next known router. The other addresses returned by the custom resolver function will be ignored.

@robsdedude robsdedude requested a review from technige April 7, 2021 15:40
Comment on lines +758 to +761
new_routing_table = self.fetch_routing_table(
address=router, timeout=self.pool_config.connection_timeout,
database=database, bookmarks=bookmarks
)
Copy link
Member Author

Choose a reason for hiding this comment

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

Make this method always return None instead of raising an exception if anything goes wrong.

@@ -786,8 +789,12 @@ def update_routing_table(self, *, database, bookmarks):
):
# Why is only the first initial routing address used?
Copy link
Member Author

Choose a reason for hiding this comment

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

pop initial router if in list and remove list comprehension further down.

@robsdedude
Copy link
Member Author

Closed in favor of #532

@robsdedude robsdedude closed this Apr 9, 2021
@robsdedude robsdedude deleted the fix-try-all-routers branch July 21, 2021 10:28
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.

1 participant