开发者社区> 问答> 正文

seata 并发测试报错

报错1:(10个并发测试的情况下)

io.seata.rm.datasource.exec.LockConflictException: get global lock fail, xid:47.112.208.130:8091:2012755620, lockKeys:t_product:1
at io.seata.rm.datasource.ConnectionProxy.recognizeLockKeyConflictException(ConnectionProxy.java:155) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:218) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.datasource.ConnectionProxy.doCommit(ConnectionProxy.java:196) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.datasource.ConnectionProxy.lambda$commit$0(ConnectionProxy.java:184) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.datasource.ConnectionProxy$LockRetryPolicy.execute(ConnectionProxy.java:289) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.datasource.ConnectionProxy.commit(ConnectionProxy.java:183) ~[seata-all-1.2.0.jar:1.2.0]
at org.springframework.jdbc.datasource.DataSourceTransactionManager.doCommit(DataSourceTransactionManager.java:330) ~[spring-jdbc-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.processCommit(AbstractPlatformTransactionManager.java:744) ~[spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at org.springframework.transaction.support.AbstractPlatformTransactionManager.commit(AbstractPlatformTransactionManager.java:712) ~[spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.commitTransactionAfterReturning(TransactionAspectSupport.java:619) ~[spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:372) ~[spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:99) ~[spring-tx-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$CglibMethodInvocation.proceed(CglibAopProxy.java:747) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at org.springframework.aop.framework.CglibAopProxy$DynamicAdvisedInterceptor.intercept(CglibAopProxy.java:689) ~[spring-aop-5.2.0.RELEASE.jar:5.2.0.RELEASE]
at com.sodix.up.service.impl.StorageServiceImpl$$EnhancerBySpringCGLIB$$9d2bf76c.updateById() ~[classes/:na]

报错2:(100个并发测试的情况下)

java.lang.IllegalMonitorStateException: attempt to unlock lock, not locked by current thread by node id: 1d244060-2558-4799-a0d3-61ac029db94f thread-id: 258
at org.redisson.RedissonLock.lambda$unlockAsync$3(RedissonLock.java:581) ~[redisson-3.12.3.jar:3.12.3]
at org.redisson.misc.RedissonPromise.lambda$onComplete$0(RedissonPromise.java:187) ~[redisson-3.12.3.jar:3.12.3]
at io.netty.util.concurrent.DefaultPromise.notifyListener0(DefaultPromise.java:577) ~[netty-all-4.1.42.Final.jar:4.1.42.Final]
at io.netty.util.concurrent.DefaultPromise.notifyListeners0(DefaultPromise.java:570) ~[netty-all-4.1.42.Final.jar:4.1.42.Final]
at io.netty.util.concurrent.DefaultPromise.notifyListenersNow(DefaultPromise.java:549) ~[netty-all-4.1.42.Final.jar:4.1.42.Final]
at io.netty.util.concurrent.DefaultPromise.notifyListeners(DefaultPromise.java:490) ~[netty-all-4.1.42.Final.jar:4.1.42.Final]
at io.netty.util.concurrent.DefaultPromise.setValue0(DefaultPromise.java:615) ~[netty-all-4.1.42.Final.jar:4.1.42.Final]
at io.netty.util.concurrent.DefaultPromise.setSuccess0(DefaultPromise.java:604) ~[netty-all-4.1.42.Final.jar:4.1.42.Final]

io.seata.core.exception.RmTransactionException: Response[ TransactionException[Could not found global transaction xid = 47.112.208.130:8091:2012755742, may be has finished.] ]
at io.seata.rm.AbstractResourceManager.branchRegister(AbstractResourceManager.java:69) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.DefaultResourceManager.branchRegister(DefaultResourceManager.java:96) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.datasource.ConnectionProxy.register(ConnectionProxy.java:238) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.datasource.ConnectionProxy.processGlobalTransactionCommit(ConnectionProxy.java:216) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.datasource.ConnectionProxy.doCommit(ConnectionProxy.java:196) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.datasource.ConnectionProxy.lambda$commit$0(ConnectionProxy.java:184) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.datasource.ConnectionProxy$LockRetryPolicy.execute(ConnectionProxy.java:289) ~[seata-all-1.2.0.jar:1.2.0]
at io.seata.rm.datasource.ConnectionProxy.commit(ConnectionProxy.java:183) ~[seata-all-1.2.0.jar:1.2.0]

展开
收起
一人吃饱,全家不饿 2021-02-02 11:32:10 6288 0
来自:阿里开源
1 条回答
写回答
取消 提交回答
  • 并发操作的数据进行forupdate以保证竞争锁条件生效.

    可以同时修改client.rm.lock.retryInterval client.rm.lock.retryTimes 这俩参数配置,达到竞争锁的周期合理性,以减少该异常的发生

    2021-02-02 11:47:55
    赞同 展开评论 打赏
来源圈子
更多
收录在圈子:
+ 订阅
阿里巴巴相信开源的世界里人人贡献代码,人人获得收益,共同创造一个互帮互利的社区,促进技术进步和发展。
问答排行榜
最热
最新

相关电子书

更多
用AI 高效测试移动应用 立即下载
移动互联网测试到质量的转变 立即下载
给ITer的技术实战进阶课-阿里CIO学院独家教材(四) 立即下载