Skip to content

Support for Fallback hosts #179

Closed
@sivaramkannan

Description

@sivaramkannan

There is an option to pass multiple hosts while creating AragoClient. But if we pass two hosts and one of the server is down, the call to connect fails with the below error

For example,

`client_hosts = ["http://127.0.0.1:8529", "http://localhost:9539"]
http_client = DefaultHTTPClient()
client2 = ArangoClient(
hosts=client_hosts,
host_resolver="random",
http_client=http_client,
serializer=json.dumps,
deserializer=json.loads,
)

db = client2.db('test', username='root', password='')
`

In the above snippet, the 2nd hosts to client_hosts http://localhost:9539 is an host that is down, the above throws below error

File "/usr/local/lib/python3.9/site-packages/requests/adapters.py", line 516, in send raise ConnectionError(e, request=request) requests.exceptions.ConnectionError: HTTPConnectionPool(host='localhost', port=9529): Max retries exceeded with url: /_db/test/_api/collection (Caused by NewConnectionError('<u rllib3.connection.HTTPConnection object at 0x1091a7b80>: Failed to establish a new connection: [Errno 61] Connection refused'))

Is it possible to implement the fallback host like we have in Java driver - https://www.arangodb.com/docs/stable/drivers/java-reference-setup.html#fallback-hosts

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions