redis / lettuce

Advanced Java Redis client for thread-safe sync, async, and reactive usage. Supports Cluster, Sentinel, Pipelining, and codecs.
https://lettuce.io
MIT License
5.36k stars 959 forks source link

Seeing ArrayIndexOutOfBoundsException #2935

Closed himanshu0791 closed 1 day ago

himanshu0791 commented 1 month ago

Bug Report

java.lang.ArrayIndexOutOfBoundsException: Index 5 out of bounds for length 5 at io.lettuce.core.internal.Futures.allOf(Futures.java:54) at io.lettuce.core.internal.AsyncConnectionProvider.close(AsyncConnectionProvider.java:166) at io.lettuce.core.cluster.PooledClusterConnectionProvider.closeAsync(PooledClusterConnectionProvider.java:513) at io.lettuce.core.cluster.ClusterDistributionChannelWriter.closeAsync(ClusterDistributionChannelWriter.java:422) at io.lettuce.core.RedisChannelHandler.closeAsync(RedisChannelHandler.java:179) at io.lettuce.core.RedisChannelHandler.close(RedisChannelHandler.java:157)

There is no specific config for when it shows up. I have seen it for default settings on v6.2.2. Its not frequent but trickles up in logs from time to time. Please let me know if I can provide any more information related to this.

tishun commented 1 month ago

Seems to me like a problem related to concurrent code execution. The stages provided to the method could change during the method execution.

We should rewrite this code to be more resilient.

Thanks for the report!