Closed yuriscom closed 8 years ago
Hello,
Can you provide the code you're using to shut down the client? Thank you.
Hi, Thanks for your reply.
I'm doing something like:
this.client = new Riak.Client(nodes);
var self = this;
this.client.ping(function(res){
if (res.code == 'ECONNREFUSED') {
winston.info("shutting down riak...");
self.client.shutdown(function (state) {
if (state === Riak.Cluster.State.SHUTDOWN) {
winston.info("done.");
}
});
}
})
Shutting down the client will be improved in the next release.
In the meantime, please see how the integration tests shut down the client and wait for the correct state:
https://github.com/basho/riak-nodejs-client/blob/v1.8.1/test/integration/kv/storevalue.js#L220
Basically, subscribe to the stateChange
event and only continue when you see the Riak.Cluster.State.SHUTDOWN
state.
Yes, I know this is clunky, which is why it will be fixed in 1.9
Will be fixed in 1.9
_[posted via JIRA by Luke Bakken]_
If connection to riak failed, i want to shutdown the client and expect that it will stop all riak processes, but it is still running and firing healthcheck errors every 30 seconds.