if (eventState.pending++ == -1) {
eventState.pending = -1;
eventState.errors++;
state = AsyncCommand.COMPLETE;
notifyFailure(new AerospikeException("Cluster has been closed"));
return;
}
and I can see that eventState.pending-- is getting called at two places:
At run() method of NioCommand class, when command deadline is exceeded (i.e., timeout)
This error happens when an async command has been initiated after AerospikeClient.close() was called. Did your code call AerospikeClient.close() around the same time you received the error?
I am calling AerospikeClient.close() in shutdown hook only. (shutdown hook is not called as I was able to see other process life-cycles working fine and Cluster has been closed error being thrown continuously).
Can you please mention what other reasons can be there to do eventState.pending’s value to be -2?
Also, please guide me towards what other logs/info can help debug this scenario.