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
We have encountered a situation where the event loop hangs after issuing redisClusterAsyncDisconnect in conditions where connection errors are likely to occur.
I may be wrong, but I have looked into possible causes:
A debug sleep 1 added in redisClusterAsyncCommandToNode timed out.
This timeout triggered updateSlotMapAsync, adding a CLUSTER NODES command.
A heavy operation (e.g. sleep 1) was executed in the commandCallback.
redisClusterAsyncDisconnect was executed in the commandCallback.
Due to the timeout of the CLUSTER NODES command (?), a retry was attempted in clusterNodesReplyCallback, which established a new connection and added another CLUSTER NODES command.
The hiredis redisProcessCallbacks did not recognize REDIS_DISCONNECTING, leading to a hang.
Is there a way to avoid the hang and successfully terminate the connections in such a scenario? In my humble opinion, it might be better not to initiate a new connection in (5) if redisClusterAsyncDisconnect has already been issued. I would appreciate your input.
Thank you.
The text was updated successfully, but these errors were encountered:
In my humble opinion, it might be better not to initiate a new connection in (5) if redisClusterAsyncDisconnect has already been issued.
Yes, it sounds reasonable that hiredis-cluster shouldn't initiate new connections when a user wants to disconnect.
When disconnecting the flag REDIS_DISCONNECTING is set in hiredis which blocks new commands on existing nodes.
But we should probably add a similar flag in hiredis-cluster to avoid creating new connections to nodes.
Hello hiredis-cluster team,
We have encountered a situation where the event loop hangs after issuing
redisClusterAsyncDisconnect
in conditions where connection errors are likely to occur.Here is a reproducible example on the current master branch. The program hangs only when
.heavyoperation
is set totrue
. Sorry for the rough example.https://gist.github.com/plainbanana/0f287c6afec4527dba566d01e98aca63
I may be wrong, but I have looked into possible causes:
debug sleep 1
added inredisClusterAsyncCommandToNode
timed out.updateSlotMapAsync
, adding aCLUSTER NODES
command.sleep 1
) was executed in thecommandCallback
.redisClusterAsyncDisconnect
was executed in thecommandCallback
.CLUSTER NODES
command (?), a retry was attempted inclusterNodesReplyCallback
, which established a new connection and added anotherCLUSTER NODES
command.redisProcessCallbacks
did not recognizeREDIS_DISCONNECTING
, leading to a hang.Is there a way to avoid the hang and successfully terminate the connections in such a scenario? In my humble opinion, it might be better not to initiate a new connection in (5) if
redisClusterAsyncDisconnect
has already been issued. I would appreciate your input.Thank you.
The text was updated successfully, but these errors were encountered: