Reputation: 1109
I am working on a Flask web service which uses Cassandra as a datastore.
The web service is setup to use a shared session for Cassandra which, I have read, automatically handle connection pooling.
When I deploy the application, everything works fine for a period of time but after a certain amount of time the session loses all C* hosts in the cluster and refuses to attempt to reconnect. It simply errors out with the message: Unable to complete the operation against any hosts
.
What can I do to either have the session automatically attempt to reconnect to the cluster or detect that the session is broken so I can shut it down and create a new session?
Upvotes: 3
Views: 917
Reputation: 11638
You should not need to create a new session. Assuming you are using the datastax python-driver, the driver maintains a 'control connection' which subscribes to node up/down events. If the control connection is lost, it will reconnect to another host in the cluster. It would be useful to turn on debug logging, which will reveal why the nodes in your cluster are being marked down.
Upvotes: 2