connect helper function does not allow definition of a retry policy
malachantrio opened this issue · 0 comments
malachantrio commented
When a Client is created using the helper function connect
the retry policy created for the client connector is a default policy with a with retries_per_node set to 0. This means that by default connections will attempt to re connect with a single endpoint forever. In the situation where some eventstore node in a cloud like setup vanishes (e.g. has been terminated either on purpose or by the cloud provider) this mean that the application would never recover it's connection. I would suggest one of two solutions
- The default is set to something that will allow it to try other nodes in the cluster
https://github.com/madedotcom/photon-pump/blob/master/photonpump/connection.py#L78
class Connector:
def __init__(
self,
discovery,
dispatcher,
retry_policy=None,
ctrl_queue=None,
connect_timeout=5,
name=None,
loop=None,
):
self.name = name
...
self.retry_policy = retry_policy or DiscoveryRetryPolicy(retries_per_node=0)
- We allow the retry policy to be passed in to
connect