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
To maximize the availability, I applied some changes to client options: ClusterClientOptions and ClusterTopologyRefreshOptions.
Current settings are shown below:
In this modification, ClusterClientOptions#validateClusterNodeMembership is set to false to acknowledge brand new nodes with new host:port regarding #109.
However, ClusterClientOptions#closeStaleConnections is left with default value: true. (Just got to have a hunch that this is somehow related...)
Simplest possible steps to reproduce
Create lettuce instance with above settings, add nodes to redis cluster, reshard, and an exception is thrown. It is thrown only once and later operations seem to run normally and as expected.
Thanks in advance.
The text was updated successfully, but these errors were encountered:
The reason for the failure: The newly created connection is opened in the same thread (EventLoop) that is assigned to the connection itself. Opening a new connection will assign a different EventLoop which is a different thread and so it eventually works. The solution should be retrying using the computation thread pool.
Previously, cluster command redirects were executed on the I/O thread. This is most of the time not an issue but in cases where lettuce did not open a connection to the target host, a connection has to be established. This is a blocking operation which blocks the event loop. The new connection is assigned in some cases (depending on the connection/event loop assignment) to the event loop which currently executes the retry. This leads to a deadlock.
Command retries are scheduled now using the event executor thread group.
Previously, cluster command redirects were executed on the I/O thread. This is most of the time not an issue but in cases where lettuce did not open a connection to the target host, a connection has to be established. This is a blocking operation which blocks the event loop. The new connection is assigned in some cases (depending on the connection/event loop assignment) to the event loop which currently executes the retry. This leads to a deadlock.
Command retries are scheduled now using the event executor thread group.
This issue was previously discovered in another question-marked issue #339 .
Below shows detailed context and error content.
lettuce version
4.2.1
Contextual information
To maximize the availability, I applied some changes to client options: ClusterClientOptions and ClusterTopologyRefreshOptions.
Current settings are shown below:
In this modification,
ClusterClientOptions#validateClusterNodeMembership
is set to false to acknowledge brand new nodes with new host:port regarding #109.However,
ClusterClientOptions#closeStaleConnections
is left with default value: true. (Just got to have a hunch that this is somehow related...)Simplest possible steps to reproduce
Create lettuce instance with above settings, add nodes to redis cluster, reshard, and an exception is thrown. It is thrown only once and later operations seem to run normally and as expected.
Thanks in advance.
The text was updated successfully, but these errors were encountered: