docs: @SuppressWarnings("unchecked")
    protected <T extends RaftRequest> void retryRequest(Throwable cause, T request, BiFunction sender, int count, int selectionId, CompletableFuture future) {
      // If the connection has not changed, reset it and connect to the next server.
      if (this.selectionId == selectionId) {
        log.trace("Resetting connection. Reason: {}", cause.getMessage());
        this.currentNode = null;
      }
  
      // Attempt to send the request again.
      sendRequest(request, sender, count, future);
    }