You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.
I have an app where I'd like to maintain availability even when I can't connect to my cassandra cluster. The rest of the app can try to make requests to the DB, and on a failure I can just put messages in a queue to be processed later.
Currently when there are no hosts available, the pool will emit an error but then proceed to throw an uncaught exception caused by accessing a property of an undefined var.
From the Pool connection code:
Pool.prototype.getConnection=function(){varlen=this.clients.length,rnd=Math.floor(Math.random()*len),host=this.clients[rnd];if(!host){this.emit('error',newError('No Available Connections'));}if(host.ready){// causes exception!!returnhost;}else{
...
}
I'd like to convert this to look more like the other query functions where if the database is unavailable for any reason, I will get an unavailable exception on querying. My app can then choose whether to re-connect in the pool and how to handle the failure.
Anything I'm missing here?
The text was updated successfully, but these errors were encountered:
I have an app where I'd like to maintain availability even when I can't connect to my cassandra cluster. The rest of the app can try to make requests to the DB, and on a failure I can just put messages in a queue to be processed later.
Currently when there are no hosts available, the pool will emit an error but then proceed to throw an uncaught exception caused by accessing a property of an undefined var.
From the
Pool
connection code:I'd like to convert this to look more like the other query functions where if the database is unavailable for any reason, I will get an unavailable exception on querying. My app can then choose whether to re-connect in the pool and how to handle the failure.
Anything I'm missing here?
The text was updated successfully, but these errors were encountered: