Skip to content

Commit

Permalink
Async cluster connection: Improve handling of missing connections (re…
Browse files Browse the repository at this point in the history
…dis-rs#968)

* aio::ClusterConnection: Report missing connections.

This change should ensure that if a connection wasn't found, after
redirecting to node, or when no random connection is available, then the
cluster connection will refresh slots.

* Add sleep to refresh slots action.

* Cancel redirects after disconnects.

If a redirected request reaches a disconnected node, the redirection
will be cancelled, and the routing will revert to the original routing.

* Move OperationTarget to Err side of result, and reduce generics.

OperationTarget is used only on errors, so it should be in the `Err` case only.
The added generics were used to hide a single type.

* Handle disconnect from all nodes.

If the async cluster connection completely disconnects from all nodes in the server, it will try again to connect to the inital nodes that were provided upon creation.

This prevents a situation where the client removes connections incrementally, until the connection map is completely empty, and there are no connections to refresh slots on.
  • Loading branch information
nihohit committed Feb 23, 2024
1 parent 26c977c commit bb895c2
Show file tree
Hide file tree
Showing 3 changed files with 538 additions and 236 deletions.
Loading

0 comments on commit bb895c2

Please sign in to comment.