Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to disable lettuce retry and shutdown application, when redis is not available #3050

Closed
Ilya-bmx opened this issue Nov 19, 2024 · 1 comment
Labels
for: external-project For an external project and not something we can fix for: stackoverflow A question that's better suited to stackoverflow.com

Comments

@Ilya-bmx
Copy link

I use StreamsBuilder
spring-boot-starter-data-redis 3.1.2.
by the way redis is available

2024-11-19 10:36:58,201 [lettuce-eventExecutorLoop-1-2] INFO i.l.core.protocol.ConnectionWatchdog - Reconnecting, last destination was 10.31.159.28/:6379
2024-11-19 10:37:08,208 [lettuce-nioEventLoop-4-1] WARN i.l.core.protocol.ConnectionWatchdog - Cannot reconnect to [10.31.159.28/:6379]: connection timed out: /10.31.159.28:6379
2024-11-19 10:37:08,301 [lettuce-eventExecutorLoop-1-3] INFO i.l.core.protocol.ConnectionWatchdog - Reconnecting, last destination was 10.31.159.28/:6379
2024-11-19 10:37:18,308 [lettuce-nioEventLoop-4-2] WARN i.l.core.protocol.ConnectionWatchdog - Cannot reconnect to [10.31.159.28/:6379]: connection timed out: /10.31.159.28:6379
2024-11-19 10:37:18,401 [lettuce-eventExecutorLoop-1-2] INFO i.l.core.protocol.ConnectionWatchdog - Reconnecting, last destination was 10.31.159.28/:6379
2024-11-19 10:37:28,408 [lettuce-nioEventLoop-4-3] WARN i.l.core.protocol.ConnectionWatchdog - Cannot reconnect to [10.31.159.28/:6379]: connection timed out: /10.31.159.28:6379
2024-11-19 10:37:28,602 [lettuce-eventExecutorLoop-1-1] INFO i.l.core.protocol.ConnectionWatchdog - Reconnecting, last destination was 10.31.159.28/:6379
2024-11-19 10:37:38,608 [lettuce-nioEventLoop-4-1] WARN i.l.core.protocol.ConnectionWatchdog - Cannot reconnect to [10.31.159.28/:6379]: connection timed out: /10.31.159.28:6379
2024-11-19 10:37:38,901 [lettuce-eventExecutorLoop-1-3] INFO i.l.core.protocol.ConnectionWatchdog - Reconnecting, last destination was 10.31.159.28/:6379
2024-11-19 10:37:48,908 [lettuce-nioEventLoop-4-2] WARN i.l.core.protocol.ConnectionWatchdog - Cannot reconnect to [10.31.159.28/:6379]: connection timed out: /10.31.159.28:6379
2024-11-19 10:37:49,501 [lettuce-eventExecutorLoop-1-2] INFO i.l.core.protocol.ConnectionWatchdog - Reconnecting, last destination was 10.31.159.28/:6379
2024-11-19 10:37:50,984 [lettuce-eventExecutorLoop-1-1] WARN o.s.b.a.d.r.RedisReactiveHealthIndicator - Redis health check failed
org.springframework.dao.QueryTimeoutException: Redis command timed out
at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:68)
at org.springframework.data.redis.connection.lettuce.LettuceReactiveRedisConnection.lambda$translateException$0(LettuceReactiveRedisConnection.java:242)
at reactor.core.publisher.Flux.lambda$onErrorMap$27(Flux.java:7201)
at reactor.core.publisher.FluxOnErrorResume$ResumeSubscriber.onError(FluxOnErrorResume.java:94)
at reactor.core.publisher.MonoFlatMapMany$FlatMapManyInner.onError(MonoFlatMapMany.java:255)
at reactor.core.publisher.MonoNext$NextSubscriber.onError(MonoNext.java:93)
at reactor.core.publisher.MonoNext$NextSubscriber.onError(MonoNext.java:93)
at io.lettuce.core.RedisPublisher$ImmediateSubscriber.onError(RedisPublisher.java:895)
at io.lettuce.core.RedisPublisher$State.onError(RedisPublisher.java:716)
at io.lettuce.core.RedisPublisher$RedisSubscription.onError(RedisPublisher.java:357)
at io.lettuce.core.RedisPublisher$SubscriptionCommand.onError(RedisPublisher.java:801)
at io.lettuce.core.RedisPublisher$SubscriptionCommand.doOnError(RedisPublisher.java:797)
at io.lettuce.core.protocol.CommandWrapper.completeExceptionally(CommandWrapper.java:128)
at io.lettuce.core.protocol.CommandExpiryWriter.lambda$potentiallyExpire$0(CommandExpiryWriter.java:175)
at io.netty.util.concurrent.PromiseTask.runTask(PromiseTask.java:98)
at io.netty.util.concurrent.ScheduledFutureTask.run(ScheduledFutureTask.java:153)
at io.netty.util.concurrent.AbstractEventExecutor.runTask(AbstractEventExecutor.java:174)
at io.netty.util.concurrent.DefaultEventExecutor.run(DefaultEventExecutor.java:66)
at io.netty.util.concurrent.SingleThreadEventExecutor$4.run(SingleThreadEventExecutor.java:997)
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:833)
Caused by: io.lettuce.core.RedisCommandTimeoutException: Command timed out after 1 minute(s)
at io.lettuce.core.internal.ExceptionFactory.createTimeoutException(ExceptionFactory.java:59)
at io.lettuce.core.protocol.CommandExpiryWriter.lambda$potentiallyExpire$0(CommandExpiryWriter.java:176)
... 8 common frames omitted
2024-11-19 10:37:50,984 [http-nio-8080-exec-7] WARN o.s.b.a.health.HealthEndpointSupport - Health contributor org.springframework.boot.actuate.autoconfigure.health.HealthEndpointConfiguration$AdaptedReactiveHealthContributors$1 (redis) took 60001ms to respond
2024-11-19 10:37:59,508 [lettuce-nioEventLoop-4-3] WARN i.l.core.protocol.ConnectionWatchdog - Cannot reconnect to [10.31.159.28/:6379]: connection timed out: /10.31.159.28:6379
2024-11-19 10:38:00,601 [lettuce-eventExecutorLoop-1-1] INFO i.l.core.protocol.ConnectionWatchdog - Reconnecting, last destination was 10.31.159.28/:6379
2024-11-19 10:38:10,608 [lettuce-nioEventLoop-4-1] WARN i.l.core.protocol.ConnectionWatchdog - Cannot reconnect to [10.31.159.28/:6379]: connection timed out: /10.31.159.28:6379
2024-11-19 10:38:12,701 [lettuce-eventExecutorLoop-1-3] INFO i.l.core.protocol.ConnectionWatchdog - Reconnecting, last destination was 10.31.159.28/:6379

@spring-projects-issues spring-projects-issues added the status: waiting-for-triage An issue we've not yet triaged label Nov 19, 2024
@mp911de
Copy link
Member

mp911de commented Nov 21, 2024

Set ClientOptions.autoReconnect to false. Alternatively, ClientOptions.disconnectedBehavior.

@mp911de mp911de closed this as not planned Won't fix, can't repro, duplicate, stale Nov 21, 2024
@mp911de mp911de added for: external-project For an external project and not something we can fix for: stackoverflow A question that's better suited to stackoverflow.com and removed status: waiting-for-triage An issue we've not yet triaged labels Nov 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
for: external-project For an external project and not something we can fix for: stackoverflow A question that's better suited to stackoverflow.com
Projects
None yet
Development

No branches or pull requests

3 participants