Skip to content

feature: host fallback support#184

Merged
aMahanna merged 11 commits into
mainfrom
feature/host-fallback-support
Dec 10, 2021
Merged

feature: host fallback support#184
aMahanna merged 11 commits into
mainfrom
feature/host-fallback-support

Conversation

@aMahanna

@aMahanna aMahanna commented Dec 3, 2021

Copy link
Copy Markdown
Contributor

Closes #179

A (working) first-draft implementation for host fallback support.

Requires feedback

What's new:

  • BaseConnection.process_request()
    • Given a request, process it until a valid response is provided, or the max amount of tries has been reached.
    • host_index is still being chosen using the resolver's get_host_index method.
  • HostResolver.max_tries : int
    • A limit to the amount of attempts made to execute the request. Value varies based on the resolver type
  • HostResolver.host_count : int
    • The number of hosts provided
  • RandomHostResolver.get_host_index()
    • Reworked to keep track of previously chosen host indexes, to make sure that the next chosen host_index is not one of them.

@aMahanna aMahanna self-assigned this Dec 3, 2021
@aMahanna aMahanna requested a review from joowani December 5, 2021 05:17

@joowani joowani 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.

Looks like a good start. I left some comments, some of which may not need to be addressed immediately if you are looking to do incremental changes.

Also, I'm not sure how much of this overlaps with active failover in ArangoDB (which python-arango does not have support for yet). I started a thread on it in the past but never got a chance to work on it. Hopefully that helps you in the future.

Comment thread arango/connection.py Outdated
Comment thread arango/resolver.py Outdated
Comment thread arango/resolver.py Outdated
Comment thread arango/connection.py Outdated
Comment thread arango/connection.py Outdated
Comment thread arango/connection.py
@aMahanna aMahanna requested a review from joowani December 5, 2021 21:29
Comment thread arango/client.py
Comment thread arango/resolver.py Outdated
Comment thread arango/connection.py
@aMahanna aMahanna requested a review from joowani December 7, 2021 15:16
@aMahanna aMahanna changed the title do not merge: host fallback support draft feature: host fallback support Dec 9, 2021

@joowani joowani 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.

Lgtm. Thanks for your contribution!

@aMahanna aMahanna merged commit 1900f4a into main Dec 10, 2021
@aMahanna aMahanna deleted the feature/host-fallback-support branch December 10, 2021 02:25
joowani pushed a commit that referenced this pull request Jan 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support for Fallback hosts

2 participants