Describe the bug when due to some network problems or redis down,the application throws error: org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out after 5 second(s) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:70) at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41) at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44) at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42) at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:271) at org.springframework.data.redis.connection.lettuce.LettuceConnection.await(LettuceConnection.java:1062) at org.springframework.data.redis.connection.lettuce.LettuceConnection.lambda$doInvoke$4(LettuceConnection.java:919) at org.springframework.data.redis.connection.lettuce.LettuceInvoker$Synchronizer.invoke(LettuceInvoker.java:673) at org.springframework.data.redis.connection.lettuce.LettuceInvoker$DefaultManyInvocationSpec.toList(LettuceInvoker.java:618) at org.springframework.data.redis.connection.lettuce.LettuceStreamCommands.xReadGroup(LettuceStreamCommands.java:348) at org.springframework.data.redis.stream.DefaultStreamMessageListenerContainer.lambda$null$3(DefaultStreamMessageListenerContainer.java:259) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:222) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:189) at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:176) at org.springframework.data.redis.stream.DefaultStreamMessageListenerContainer.lambda$getReadFunction$4(DefaultStreamMessageListenerContainer.java:258) at org.springframework.data.redis.stream.StreamPollTask.readRecords(StreamPollTask.java:166) at org.springframework.data.redis.stream.StreamPollTask.doLoop(StreamPollTask.java:147) at org.springframework.data.redis.stream.StreamPollTask.run(StreamPollTask.java:132) at java.base/java.lang.Thread.run(Thread.java:834) Caused by: io.lettuce.core.RedisCommandTimeoutException: Command timed out after 5 second(s) at io.lettuce.core.internal.ExceptionFactory.createTimeoutException(ExceptionFactory.java:53) at io.lettuce.core.internal.Futures.awaitOrCancel(Futures.java:246) at io.lettuce.core.LettuceFutures.awaitOrCancel(LettuceFutures.java:74) at org.springframework.data.redis.connection.lettuce.LettuceConnection.await(LettuceConnection.java:1060) ... 13 common frames omitted
when redis resumes again。stream consumers will no longer consumer, subscition not active,i need torebind the listener in the program to continue consum。
So I wonder if redis can solve this problem internally, catching the reconnection error keeps the TaskSubscition active all the time
Comment From: yossigo
@Doublemini This is a client side issue, that needs to be addressed by Lettuce or Spring. On the server side, Redis has no way to associate the reconnected connections to the previous ones.