public int calculateRetryAttempts(Throwable cause) {

    int maxRetryAttempts = getRetryAttempts();

    if (maxRetryAttempts == PoolFactory.DEFAULT_RETRY_ATTEMPTS) {
      // If the retryAttempt is set to default(-1). Try executing on all servers once.
      // As calculating number of servers involves sending message to locator, it is
      // done only when there is an exception.
      if (cause instanceof ServerConnectivityException
          && cause.getMessage().contains(ConnectionManagerImpl.SOCKET_TIME_OUT_MSG)) {
        // The request was sent once.
        maxRetryAttempts = getConnectionSource().getAllServers().size() - 1;
      } else {
        // The client was unable to establish a connection before sending the
        // request.
        maxRetryAttempts = getConnectionSource().getAllServers().size();
      }
    }

    return maxRetryAttempts;
  }
This is only for multi-user case

Assert thread-local var is not null.

If serverLocation is non-null, check if the the user is authenticated on that server. If not,
authenticate it and return.
geode-core/src/main/java/org/apache/geode/cache/client/internal/PoolImpl.java