I'm wondering whether there is a way for me to know whether the connection to all Cassandra nodes was lost by the C++ driver.
My application has a proxy server which connects to Cassandra once and sits there forever. Other services will connect to that proxy server and send requests as required.
That works great, until all the connections to the Cassandra cluster are lost. In that special circumstance, the proxy does not seem to recover...
Is there a way for me to know/detect that all connections were lost and thus attempt a connect() again?
I have the same situation and the best solution is to check the error from the request/query you make to Cassandra. I just tested this and if all connections are gone, the driver immediately returns:
CASS_ERROR_LIB_NO_HOSTS_AVAILABLE
That's the solution I'm going myself with as I couldn't find a better one and actually this one works for me as it doesn't wait for a specific timeout but return immediately.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With