【问题解决】org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io

2023-11-17

1.出现问题异常

核心错误输出

org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out after 1 minute(s)

异常详细

org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in class path resource [org/springframework/boot/autoconfigure/session/RedisSessionConfiguration$SpringBootRedisHttpSessionConfiguration.class]: Invocation of init method failed; nested exception is org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out after 1 minute(s)
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1799) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.doCreateBean(AbstractAutowireCapableBeanFactory.java:594) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:516) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.lambda$doGetBean$0(AbstractBeanFactory.java:324) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory$$Lambda$202/1705969074.getObject(Unknown Source) ~[na:na]
	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:234) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.doGetBean(AbstractBeanFactory.java:322) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:202) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:897) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.finishBeanFactoryInitialization(AbstractApplicationContext.java:879) ~[spring-context-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:551) ~[spring-context-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	at org.springframework.boot.web.servlet.context.ServletWebServerApplicationContext.refresh(ServletWebServerApplicationContext.java:143) ~[spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:755) [spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
	at org.springframework.boot.SpringApplication.refresh(SpringApplication.java:747) [spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
	at org.springframework.boot.SpringApplication.refreshContext(SpringApplication.java:402) [spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:312) [spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1247) [spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
	at org.springframework.boot.SpringApplication.run(SpringApplication.java:1236) [spring-boot-2.3.12.RELEASE.jar:2.3.12.RELEASE]
	at com.gdones.wms.GDonesWMSApplication.main(GDonesWMSApplication.java:27) [classes/:na]
Caused by: org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out after 1 minute(s)
	at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:70) ~[spring-data-redis-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41) ~[spring-data-redis-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44) ~[spring-data-redis-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42) ~[spring-data-redis-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:275) ~[spring-data-redis-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.data.redis.connection.lettuce.LettuceServerCommands.convertLettuceAccessException(LettuceServerCommands.java:571) ~[spring-data-redis-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.data.redis.connection.lettuce.LettuceServerCommands.getConfig(LettuceServerCommands.java:307) ~[spring-data-redis-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.data.redis.connection.DefaultedRedisConnection.getConfig(DefaultedRedisConnection.java:1381) ~[spring-data-redis-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	at org.springframework.session.data.redis.config.ConfigureNotifyKeyspaceEventsAction.getNotifyOptions(ConfigureNotifyKeyspaceEventsAction.java:76) ~[spring-session-data-redis-2.3.3.RELEASE.jar:2.3.3.RELEASE]
	at org.springframework.session.data.redis.config.ConfigureNotifyKeyspaceEventsAction.configure(ConfigureNotifyKeyspaceEventsAction.java:57) ~[spring-session-data-redis-2.3.3.RELEASE.jar:2.3.3.RELEASE]
	at org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration$EnableRedisKeyspaceNotificationsInitializer.afterPropertiesSet(RedisHttpSessionConfiguration.java:333) ~[spring-session-data-redis-2.3.3.RELEASE.jar:2.3.3.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1858) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1795) ~[spring-beans-5.2.15.RELEASE.jar:5.2.15.RELEASE]
	... 18 common frames omitted
Caused by: io.lettuce.core.RedisCommandTimeoutException: Command timed out after 1 minute(s)
	at io.lettuce.core.ExceptionFactory.createTimeoutException(ExceptionFactory.java:51) ~[lettuce-core-5.3.7.RELEASE.jar:5.3.7.RELEASE]
	at io.lettuce.core.LettuceFutures.awaitOrCancel(LettuceFutures.java:119) ~[lettuce-core-5.3.7.RELEASE.jar:5.3.7.RELEASE]
	at io.lettuce.core.FutureSyncInvocationHandler.handleInvocation(FutureSyncInvocationHandler.java:75) ~[lettuce-core-5.3.7.RELEASE.jar:5.3.7.RELEASE]
	at io.lettuce.core.internal.AbstractInvocationHandler.invoke(AbstractInvocationHandler.java:79) ~[lettuce-core-5.3.7.RELEASE.jar:5.3.7.RELEASE]
	at com.sun.proxy.$Proxy189.configGet(Unknown Source) ~[na:na]
	at org.springframework.data.redis.connection.lettuce.LettuceServerCommands.getConfig(LettuceServerCommands.java:305) ~[spring-data-redis-2.3.9.RELEASE.jar:2.3.9.RELEASE]
	... 24 common frames omitted

2.问题原因

  • 可能是Redis服务长时间处于高并发情况,或服务异常断链
  • 它表示Redis命令超时了。嵌套异常io.lettuce.core.RedisCommandTimeoutException指出具体的Redis命令超时异常细节。根据异常信息,这个Redis命令在1分钟后超时了,可能是由于Redis服务器太忙或者网络延迟等原因导致的。为了解决这个问题,可以尝试增加Redis服务器的性能、优化Redis命令或者调整系统配置来提高网络稳定性,以减少超时的概率。

3.解决方法

  1. 增加Redis服务器的性能:可以通过增加Redis服务器的内存、CPU和网络带宽等资源来提高其性能,从而减少Redis命令超时的概率。
  2. 优化Redis命令:可以检查应用程序中使用的Redis命令是否存在性能瓶颈,并尝试进行优化。例如,可以减小Redis数据集的大小,或者使用更有效的Redis命令(例如使用SCAN命令代替KEYS命令)。
  3. 调整系统配置以提高网络稳定性:如果超时是由于网络延迟或不稳定性导致的,则可以尝试调整系统配置来提高网络稳定性,例如增加网络带宽、减小TCP超时时间等。
  4. 使用合适的Redis客户端库:可以考虑使用性能更好、更稳定的Redis客户端库,例如Jedis或Lettuce。这些客户端库通常具有更好的错误处理功能,并且能够更好地处理Redis命令超时等异常情况。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)

【问题解决】org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io 的相关文章

  • 如何使用 FileChannel 将一个文件的内容附加到另一个文件的末尾?

    File a txt好像 ABC File d txt好像 DEF 我正在尝试将 DEF 附加到 ABC 所以a txt好像 ABC DEF 我尝试过的方法总是完全覆盖第一个条目 所以我总是最终得到 DEF 这是我尝试过的两种方法 File
  • AES 加密 Java/plsql

    我需要在Java和plsql DBMS CRYPTO for Oracle 10g 上实现相同的加密 解密应用程序 两种实现都工作正常 但这里的问题是我对相同纯文本的加密得到了不同的输出 下面是用于加密 解密过程的代码 Java 和 PLS
  • manifest.mf 文件的附加内容的约定?

    Java JAR 中的 MANIFEST MF 文件是否有任何超出 MANIFEST MF 约定的约定 JAR规范 http download oracle com javase 1 4 2 docs guide jar jar html
  • JNI 不满意链接错误

    我想创建一个简单的 JNI 层 我使用Visual studio 2008创建了一个dll Win 32控制台应用程序项目类型 带有DLL作为选项 当我调用本机方法时 出现此异常 Exception occurred during even
  • Redis+Docker+Django - 错误 111 连接被拒绝

    我正在尝试使用 Redis 作为使用 Docker Compose 的 Django 项目的 Celery 代理 我无法弄清楚我到底做错了什么 但尽管控制台日志消息告诉我 Redis 正在运行并接受连接 事实上 当我这样做时 docker
  • ExceptionConverter:java.io.IOException:文档没有页面。我正在使用 iText

    当我执行下面的代码时 File f new File c sample pdf PdfWriter getInstance document new FileOutputStream f document open System out p
  • CXF Swagger2功能添加安全定义

    我想使用 org apache cxf jaxrs swagger Swagger2Feature 将安全定义添加到我的其余服务中 但是我看不到任何相关方法或任何有关如何执行此操作的资源 下面是我想使用 swagger2feature 生成
  • java.io.IOException: %1 不是有效的 Win32 应用程序

    我正在尝试对 XML 文档进行数字签名 为此我有两个选择 有一个由爱沙尼亚认证中心为程序员创建的库 还有一个由银行制作的运行 Java 代码的脚本 如果使用官方 认证中心 库 那么一切都会像魅力一样进行一些调整 但是当涉及到银行脚本时 它会
  • Convert.FromBase64String 方法的 Java 等效项

    Java 中是否有相当于Convert FromBase64String http msdn microsoft com en us library system convert frombase64string aspx which 将指
  • 如何在 Java 中禁用 System.out 以提高速度

    我正在用 Java 编写一个模拟重力的程序 其中有一堆日志语句 到 System out 我的程序运行速度非常慢 我认为日志记录可能是部分原因 有什么方法可以禁用 System out 以便我的程序在打印时不会变慢 或者我是否必须手动检查并
  • 如何从表中检索特定列 --- JPA 或 CrudRepository?我只想从用户表中检索电子邮件列

    用户模型 Entity Table name user uniqueConstraints UniqueConstraint columnNames email public class User implements Serializab
  • 使用替换字符串中多个单词的最有效方法[重复]

    这个问题在这里已经有答案了 此刻我正在做 Example line replaceAll replaceAll cat dog replaceAll football rugby 我觉得那很丑 不确定有更好的方法吗 也许循环遍历哈希图 ED
  • Microsoft Graph 身份验证 - 委派权限

    我可以使用 Microsoft Graph 访问资源无需用户即可访问 https developer microsoft com en us graph docs concepts auth v2 service 但是 此方法不允许我访问需
  • 迁移到 java 17 后有关“每个进程的内存映射”和 JVM 崩溃的 GC 警告

    我们正在将 java 8 应用程序迁移到 java 17 并将 GC 从G1GC to ZGC 我们的应用程序作为容器运行 这两个基础映像之间的唯一区别是 java 的版本 例如对于 java 17 版本 FROM ubuntu 20 04
  • 检查 Android 手机上的方向

    如何查看Android手机是横屏还是竖屏 当前配置用于确定要检索的资源 可从资源中获取Configuration object getResources getConfiguration orientation 您可以通过查看其值来检查方向
  • 检查 protobuf 消息 - 如何按名称获取字段值?

    我似乎无法找到一种方法来验证 protobuf 消息中字段的值 而无需显式调用其 getter 我看到周围的例子使用Descriptors FieldDescriptor实例到达消息映射内部 但它们要么基于迭代器 要么由字段号驱动 一旦我有
  • 应用程序关闭时的倒计时问题

    我制作了一个 CountDownTimer 代码 我希望 CountDownTimer 在完成时重新启动 即使应用程序已关闭 但它仅在应用程序正在运行或重新启动应用程序时重新启动 因此 如果我在倒计时为 00 10 分钟 秒 时关闭应用程序
  • Tomcat 6找不到mysql驱动

    这里有一个类似的问题 但关于类路径 ClassNotFoundException com mysql jdbc Driver https stackoverflow com questions 1585811 classnotfoundex
  • Java - 不要用 bufferedwriter 覆盖

    我有一个程序可以将人员添加到数组列表中 我想做的是将这些人也添加到文本文件中 但程序会覆盖第一行 因此这些人会被删除 如何告诉编译器在下一个空闲行写入 import java io import java util import javax
  • 将 JTextArea 内容写入文件

    我在 Java Swing 中有一个 JTextArea 和一个 提交 按钮 需要将textarea的内容写入一个带有换行符的文件中 我得到的输出是这样的 它被写为文件中的一个字符串 try BufferedWriter fileOut n

随机推荐

  • Linux基础命令大全(下)

    作者 小刘在C站 个人主页 小刘主页 每天分享云计算网络运维课堂笔记 努力不一定有回报 但一定会有收获加油 一起努力 共赴美好人生 夕阳下 是最美的绽放 树高千尺 落叶归根人生不易 人间真情 目录 前言 编辑 一 命令到末行模式
  • 今日头条 文章采集_如何利用文章在今日头条引流精准粉

    今日头条这个平台 基本上从事互联网项目的人应该都知道 平台流量本身是非常庞大的 采用大数据算法推荐机制 自动采集判断用户的喜好 并且推荐的量也是非常可观的 对于那些知名作者而言 一篇文章即可拥有几十万甚至数百万的阅读量 这么大的一个流量池摆
  • Java调用Win API

    官方网站 http jawinproject sourceforge net 把lib文件夹下的jawin jar和jawin stubs jar放到 JAVA HOME jre lib ext 目录下 把bin文件夹下的jawin dll
  • 永磁同步电机矢量控制到无速度传感器控制学习教程(PMSM)(一)

    一个阶段的学习结束了 整理了之前的过程中的学习成果 已经过了工作的年纪 在这里稍微出一下自己做的一套永磁同步电机的教程 从基础的矢量控制 到应用性较强的MTPA 弱磁控制等 最后深入到无速度传感器的控制 搜集了三种无速度的方法 足够大家从基
  • html/css笔记 table表格文本垂直水平居中对齐方法

    简介 平时工作中开发经常会遇到html网页样式设计 这里记录一下笔记方便后期查看 也顺便给其他人提供一个参考 HTML 文本垂直水平居中对齐方法 一 css样式 水平居中 text align 应用于块级元素的文本水平居中 text ali
  • React 中ref的几种用法

    React 中ref的几种用法 1 字符串 通过 this refs a 来引用真实dom的节点 dom 节点上使用
  • 结构光相机国产、非国产统计参数对比分析

    结构光相机国产 非国产统计参数对比分析 1 Kinect v1 Kinect v1深度相机拥有一个RGB彩色摄像头 一个红外线CMOS摄像机和一个红外发射器 相机的红外线CMOS摄像机和红外发射器以左右水平的方式分布 该相机采用的是以结构光
  • Unix环境下Oracle数据库完全优化详解

    Unix环境下Oracle数据库完全优化详解 2007 04 19 12 54 02 作者 changelive 浏览次数 14 文字大小 大 中 小 进入论坛 如今的优化己经向优化等待 waits 转型了 实际中性能优化最根本的出现点也都
  • Windows驱动开发第11课(R3与R0通信交换数据第二节)

    在上一节课我们证实了在用户层调用CreateFile函数时 相应的在驱动层会响应一个IRP MJ CREATE的事件 这节课我们来看看用户层和驱动层是怎么交换数据的 首先来介绍一下控制码 由CTL CODE宏创建 是一个唯一的32位系统I
  • 数据库系统原理(第二版)知识点总结

    目录 第一章 概述 基本知识 数据模型 数据模型的组成要素 数据模型的分类 数据库系统的结构 第二章 关系运算 2 1 关系运算语言 1 关系代数语言 第三章 数据完整性 实体完整性 主属性的取值不能为空值 主属性的候选键的取值要非空且唯一
  • Python中的一些特殊函数

    https www cnblogs com maybe2030 p 4678920 html
  • centos7系统启动流程

    开机自检 gt 查找第一启动项设备 gt 加载第一启动项设备上的bootloader 存在于MBR中 gt 加载内核 initramfs gt 只读加载rootfs gt sbin init 即systemd
  • Flask 数据库 连接池、DBUtils、http 连接池

    1 DBUtils 简介 使用 DBUtils 简介 DBUtils 是一套用于管理 数据库 连接池 的Python包 为 高频度 高并发 的数据库访问提供更好的性能 可以自动管理连接对象的创建和释放 并允许对非线程安全的数据库接口进行线程
  • vector 查找_怎么写出无bug的二分查找算法代码

    封面图来自 geeksforgeeks 1 简介 二分查找算法是一类比较基础的算法 然而想要短时间内 写出二分查找的无 bug 版本 也不是很容易的 为此我查找了一些资料 终于弄清了二分查找算法的套路 在此分享给大家 也算是对自己学习知识的
  • Chisel3实践用例,安装

    新建SBT工程 sbt version 1 2 8 name ScalaExample version 0 1 scalaVersion 2 12 8
  • @Transient 理解

    transient使用小结 1 一旦变量被transient修饰 变量将不再是对象持久化的一部分 该变量内容在序列化后无法获得访问 2 transient关键字只能修饰变量 而不能修饰方法和类 注意 本地变量是不能被transient关键字
  • YOLOV2个人理解总结

    YOLOv2框架图 YOLOv2改进之处 1 Batch Normalization BN Batch Normalization 层简单讲就是对网络的每一层的输入都做了归一化 这样网络就不需要每层都去学数据的分布 收敛会快点 原来的YOL
  • 面试题:如何测试登录功能

    最近在做一个创新项目 这个项目有二个平台 每个平台都有前后端 故有四个系统 每个系统都有登录功能 而且不同系统代码设计方式都有所差异 所以就这个登录功能而言就要测试四次 看似一个简单的登录功能其中设计的测试点也是相当复杂 今天就讲讲如何测试
  • php scp跨服器拷贝文件到sftp

    一般要装php的ssh2扩展 比较麻烦 所以转念一想 为什么不用我们经常用的scp 但是scp跨服务器拷贝需要输入密码 这里就用到了一个工具试试sshpass 可以指定密码 1 工具安装 ubuntu安装 sudo apt get inst
  • 【问题解决】org.springframework.dao.QueryTimeoutException: Redis command timed out; nested exception is io

    1 出现问题异常 核心错误输出 org springframework dao QueryTimeoutException Redis command timed out nested exception is io lettuce cor