Closed rahulKrishnaM closed 6 months ago
Your reasoning sounds fair and I currently can't see the reason why either. The check was added in https://github.com/Nordix/hiredis-cluster/commit/b960bbf833523f0e0a284ecd8b15be5f457a9aaa I will look a bit more, but I also think we should changed this.
Hi,
If there are some pending requests in hiredis queue, and if the application invokes
redisClusterAsyncDisconnect()
api, as per the below code block,redisAsyncDisconnect()
would get called for all the nodes in the dictionary, which will then eventually invoke callbacks for all the pending requests in queue with NULL reply.https://github.com/Nordix/hiredis-cluster/blob/88f9487fed252b8434e3e82f268c3ce5ce351831/hircluster.c#L4402C1-L4412C6
But if a particular node has seen some error (ac->err is true), invoking the
redisClusterAsyncDisconnect()
api is skipped.if (ac == NULL || ac->err) { continue; }
Is there a reason why we do this? We actually in our application want all the callbacks to be invoked from hiredis. However, if a scenario as above happens, we will miss the callback from hiredis. Can you let us know if this check(ac->err) is present here for a reason?
cc: @bjosv