4.5K Star 43K Fork 12.6K

GVPlengleng / pig

 / 详情

使用seata分布式锁时,接口耗时超过1秒就会异常

已完成
成员
创建于  
2024-04-02 22:17

环境信息

  • java 版本: 8

  • pigx 版本: 5.2.0

  • 架构类型: 微服务

提供详细日志、截图、回显步骤 (无详细报错和说明,直接关闭)

2024-04-02 22:04:31.194 ERROR 23240 --- [ XNIO-1 task-1] c.t.c.c.s.h.GlobalBizExceptionHandler : 全局异常信息 ex=

Error updating database. Cause: java.sql.SQLException: failed to register xa branch 192.168.17.24:8091:5882207507724582922 since GlobalTransactionStatusInvalid:Response[ TransactionException[Could not register branch into global session xid = 192.168.17.24:8091:5882207507724582922 status = TimeoutRollbacking while expecting Begin] ]

The error may exist in com/tch/cloud/admin/mapper/ToPersonMapper.java (best guess)

The error may involve com.tch.cloud.admin.mapper.ToPersonMapper.insert-Inline

The error occurred while setting parameters

SQL: INSERT INTO tc_demo.to_person (id, name, birthday, blood_code, old_name, sign, create_time, update_time, del_flag) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)

Cause: java.sql.SQLException: failed to register xa branch 192.168.17.24:8091:5882207507724582922 since GlobalTransactionStatusInvalid:Response[ TransactionException[Could not register branch into global session xid = 192.168.17.24:8091:5882207507724582922 status = TimeoutRollbacking while expecting Begin] ]

; uncategorized SQLException; SQL state [null]; error code [0]; failed to register xa branch 192.168.17.24:8091:5882207507724582922 since GlobalTransactionStatusInvalid:Response[ TransactionException[Could not register branch into global session xid = 192.168.17.24:8091:5882207507724582922 status = TimeoutRollbacking while expecting Begin] ]; nested exception is java.sql.SQLException: failed to register xa branch 192.168.17.24:8091:5882207507724582922 since GlobalTransactionStatusInvalid:Response[ TransactionException[Could not register branch into global session xid = 192.168.17.24:8091:5882207507724582922 status = TimeoutRollbacking while expecting Begin] ]

org.springframework.jdbc.UncategorizedSQLException:

Error updating database. Cause: java.sql.SQLException: failed to register xa branch 192.168.17.24:8091:5882207507724582922 since GlobalTransactionStatusInvalid:Response[ TransactionException[Could not register branch into global session xid = 192.168.17.24:8091:5882207507724582922 status = TimeoutRollbacking while expecting Begin] ]

The error may exist in com/tch/cloud/admin/mapper/ToPersonMapper.java (best guess)

The error may involve com.tch.cloud.admin.mapper.ToPersonMapper.insert-Inline

The error occurred while setting parameters

SQL: INSERT INTO tc_demo.to_person (id, name, birthday, blood_code, old_name, sign, create_time, update_time, del_flag) VALUES (?, ?, ?, ?, ?, ?, ?, ?, ?)

Cause: java.sql.SQLException: failed to register xa branch 192.168.17.24:8091:5882207507724582922 since GlobalTransactionStatusInvalid:Response[ TransactionException[Could not register branch into global session xid = 192.168.17.24:8091:5882207507724582922 status = TimeoutRollbacking while expecting Begin] ]

; uncategorized SQLException; SQL state [null]; error code [0]; failed to register xa branch 192.168.17.24:8091:5882207507724582922 since GlobalTransactionStatusInvalid:Response[ TransactionException[Could not register branch into global session xid = 192.168.17.24:8091:5882207507724582922 status = TimeoutRollbacking while expecting Begin] ]; nested exception is java.sql.SQLException: failed to register xa branch 192.168.17.24:8091:5882207507724582922 since GlobalTransactionStatusInvalid:Response[ TransactionException[Could not register branch into global session xid = 192.168.17.24:8091:5882207507724582922 status = TimeoutRollbacking while expecting Begin] ]
at org.mybatis.spring.MyBatisExceptionTranslator.translateExceptionIfPossible(MyBatisExceptionTranslator.java:93) ~[mybatis-spring-2.1.1.jar:2.1.1]
at org.mybatis.spring.SqlSessionTemplate$SqlSessionInterceptor.invoke(SqlSessionTemplate.java:439) ~[mybatis-spring-2.1.1.jar:2.1.1]
at jdk.proxy2/jdk.proxy2.$Proxy209.insert(Unknown Source) ~[na:na]
at org.mybatis.spring.SqlSessionTemplate.insert(SqlSessionTemplate.java:272) ~[mybatis-spring-2.1.1.jar:2.1.1]
at com.baomidou.mybatisplus.core.override.MybatisMapperMethod.execute(MybatisMapperMethod.java:59) ~[mybatis-plus-core-3.5.3.2.jar:3.5.3.2]
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy$PlainMethodInvoker.invoke(MybatisMapperProxy.java:148) ~[mybatis-plus-core-3.5.3.2.jar:3.5.3.2]
at com.baomidou.mybatisplus.core.override.MybatisMapperProxy.invoke(MybatisMapperProxy.java:89) ~[mybatis-plus-core-3.5.3.2.jar:3.5.3.2]
at jdk.proxy2/jdk.proxy2.$Proxy210.insert(Unknown Source) ~[na:na]

评论 (3)

Github Action 创建了任务

当前非工作时间 工单处理可能会延期 请知悉

工单正在为您分配处理, 可扫码接收此工单进度通知

检查一下 seata server / 微服务应用、 数据库 这三个所在机器的服务器时间是否一致

时间是一致的。而且我发现一个现象,现象如下:

  1. A调用B,先在A操作表,远程B操作表,此时多长时间都没有问题。
  2. 同样A调用B,先远程B操作表,再A操作表,此时非常容易报错(特别是超过1秒时,几乎100%报错)
lbw 任务状态待办的 修改为已完成

登录 后才可以发表评论

状态
负责人
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
参与者(2)
393021 springcloud777 1591517090 410595 log4j 1591768487
Java
1
https://gitee.com/log4j/pig.git
git@gitee.com:log4j/pig.git
log4j
pig
pig

搜索帮助