Lettuce Redis 客户端中任意 io.lettuce.core.RedisCommandTimeoutException

问题描述 投票:0回答:0

我们通过 Spring Data Redis 使用 Lettuce,Redis Server 是一个 GCP Memorystore 服务。我们的应用程序中有一个简单的 Redis 独立配置,其中单个 RedisClient 在整个应用程序中的多个线程之间共享。我们获取有状态的 RedisCommands(redisClient.connect().sync()) 对象来执行 Redis 命令。我们使用的唯一 Redis 命令是 setex、get、del、incr、pttl 和 set。

偶尔,我们会在众多应用程序节点中的任何一个上看到以下 RedisCommandTimeout 异常,我们需要重新启动节点才能从该异常中恢复。

这里的任何见解都会有帮助。

stack_trace:io.lettuce.core.RedisCommandTimeoutException: Command timed out after 20 second(s)
    at io.lettuce.core.ExceptionFactory.createTimeoutException(ExceptionFactory.java:51)
    at io.lettuce.core.LettuceFutures.awaitOrCancel(LettuceFutures.java:114)
    at io.lettuce.core.FutureSyncInvocationHandler.handleInvocation(FutureSyncInvocationHandler.java:69)
    at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:80)
    at com.sun.proxy.$Proxy133.get(Unknown Source)

此外,当我们检查线程转储时,我看到大约 128 个线程,其名称如 redisson-netty-5-1、redisson-netty-5-2...redisson-netty-5-128。预计会有这么多线程吗?

redis timeoutexception lettuce google-cloud-memorystore
© www.soinside.com 2019 - 2024. All rights reserved.