title: io.lettuce.core.RedisCommandTimeoutException: Command timed out
body: <pre><code>io.lettuce.core.RedisCommandTimeoutException: Command timed out after 10 second(s)
      at io.lettuce.core.ExceptionFactory.createTimeoutException(ExceptionFactory.java:51) ~[lettuce-core-5.1.6.RELEASE.jar:?]
      at io.lettuce.core.LettuceFutures.awaitOrCancel(LettuceFutures.java:114) ~[lettuce-core-5.1.6.RELEASE.jar:?]
      at io.lettuce.core.cluster.ClusterFutureSyncInvocationHandler.handleInvocation(ClusterFutureSyncInvocationHandler.java:123) ~[lettuce-core-5.1.6.RELEASE.jar:?]
      at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80) ~[lettuce-core-5.1.6.RELEASE.jar:?]
      at com.sun.proxy.$Proxy72.get(Unknown Source) ~[?:?]
      at sun.reflect.GeneratedMethodAccessor138.invoke(Unknown Source) ~[?:?]
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43) ~[?:1.8.0_212]
      at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_212]
      at io.lettuce.core.support.ConnectionWrapping$DelegateCloseToConnectionInvocationHandler.handleInvocation(ConnectionWrapping.java:191) ~[lettuce-core-5.1.6.RELEASE.jar:?]
      at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80) ~[lettuce-core-5.1.6.RELEASE.jar:?]
      at com.sun.proxy.$Proxy72.get(Unknown Source) ~[?:?]
  </code></pre>
  
  <p>I'm using the following sample code to get the connection through connection pool, Please check and suggest what am I doing wrong</p>
  
  <pre><code>public StatefulRedisClusterConnection&lt;String, String&gt; getRedisClient() {
          log.debug("getRedisClient()");
          if (pool == null) {
              synchronized (this) {
                  pool = initializeConnectionPool();
              }
          }
          try {
              return pool.borrowObject();
          } catch (Exception e) {
              log.error("getting pool connection failed",e);
          }
          return null;
      }
  
      public GenericObjectPool&lt;StatefulRedisClusterConnection&lt;String, String&gt;&gt; initializeConnectionPool() {
          RedisClusterClient clusterClient = RedisClusterClient.create(new RedisURI(clusterUrl, clusterPort,Duration.ofMillis(10000)));
          ClusterTopologyRefreshOptions topologyRefreshOptions = ClusterTopologyRefreshOptions.builder()
                    .enableAllAdaptiveRefreshTriggers()
                    .refreshTriggersReconnectAttempts(30)
                    .build();
          clusterClient.setOptions(ClusterClientOptions.builder()
                  .topologyRefreshOptions(topologyRefreshOptions)
                  .build());
          pool = ConnectionPoolSupport.createGenericObjectPool(() -&gt; clusterClient.connect(), getLettucePoolConfig());
          return pool;
      }
  
  private GenericObjectPoolConfig getLettucePoolConfig() {
          GenericObjectPoolConfig poolConfig = new GenericObjectPoolConfig();
          poolConfig.setMaxTotal(256);
          poolConfig.setBlockWhenExhausted(true);
          poolConfig.setMaxWaitMillis(10000);
          poolConfig.setMaxIdle(100);
          poolConfig.setMinIdle(50);
          poolConfig.setTestOnBorrow(false);
          poolConfig.setTestWhileIdle(true);
          return poolConfig;
      }
  </code></pre>