code: @Override
      public Connection getConnection(ConnectionRequestContext requestContext) throws SQLException {
          int remainingAttempts = retryAttempts;
          try {
              do {
                  try {
                      return getConnectionFactory().getConnection(requestContext);
                  } catch (AcquireTimeoutException e) {
                      requestContext.incrementAttempts();
                      remainingAttempts--;
                      LOGGER.warn("Can't acquireConnection connection, remaining retry attempts {}", remainingAttempts);
                      if (remainingAttempts <= 0) {
                          throw e;
                      }
                  }
              } while (true);
          } finally {
              int attemptedRetries = requestContext.getRetryAttempts();
              if (attemptedRetries > 0) {
                  retryAttemptsHistogram.update(attemptedRetries);
              }
          }
      }
docs: {@inheritDoc}