神秘异常,找不到原因

最近线上服务器过一段时间时不时的就报redis连接失败,导致整个系统崩溃,这是什么原因呢?项目有使用netty

2022-08-13 22:55:47 [XNIO-1 task-5] ERROR io.undertow.request - UT005023: Exception handling request to /spotorder-system/ac/order/orderInfo/toSettleAccounts
org.redisson.client.RedisTimeoutException: Unable to acquire connection! RedissonPromise [promise=ImmediateEventExecutor$ImmediatePromise@23d9c994(failure: java.util.concurrent.CancellationException)]Increase connection pool size. Node source: NodeSource [slot=0, addr=null, redisClient=null, redirect=null, entry=null], command: (GET), params: [citylife-system:login_tokens:91ce1d28-65ec-49b1-9f7b-39014c5231fe] after 0 retry attempts
at org.redisson.command.RedisExecutor$2.run(RedisExecutor.java:187)
at io.netty.util.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:669)
at io.netty.util.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:744)
at io.netty.util.HashedWheelTimer$Worker.run(HashedWheelTimer.java:469)
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.lang.Thread.run(Thread.java:748)

这个看起来不是redis所在的服务器网络有问题,就是redis服务器里面连接数过多,你可以去redis服务器上看看有多少连接没被释放的,可能是你写的程序释放连接存在些问题

这个错误是 redis 客户端组件-redisson 抛出来的,表示 redisson 的连接池不够用,可以尝试调大一些

netty 线程都处于繁忙状态,导致 Redis 响应解码和向 Redis 发送命令时出现延迟