Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

其中一个服务在confirm后抛出异常的问题 #37

Open
172167396 opened this issue Jan 17, 2022 · 3 comments
Open

其中一个服务在confirm后抛出异常的问题 #37

172167396 opened this issue Jan 17, 2022 · 3 comments

Comments

@172167396
Copy link

请问当其中一个服务在confirm时抛出runtimeException之后,该服务执行了cancel,但是其他几个服务全都confirm了,这种情况怎么处理
报错打印为
2022-01-17 16:33:49,137 ERROR [pool-1-thread-1] o.b.b.s.s.XAResourceDeserializerImpl - can not find a matching xa-resource(beanId= xxx.xx.x.xxx:springboot-order-service:6001)!
2022-01-17 16:33:49,145 INFO [pool-1-thread-1] o.b.b.CompensableTransactionImpl - 018c200e5a84a93eabc889011bfb5f06| compensable transaction rolled back!
2022-01-17 16:34:49,249 INFO [pool-1-thread-1] o.b.b.CompensableTransactionImpl - 018c200e5a84a93eabc889011bfb5f06| forget transaction.
2022-01-17 16:34:50,410 ERROR [http-nio-6003-exec-6] o.b.b.CompensableCoordinator - Error occurred while committing transaction: 018c200e5a84a93eabc889011bfb5f06.
javax.transaction.xa.XAException: null
at org.bytesoft.bytetcc.CompensableCoordinator.invokeCommit(CompensableCoordinator.java:223)

@liuyangming
Copy link
Owner

从你提供的日志,看不出问题所在。你先确认一下,该事务对应的数据是否出现不一致了?如果的确出现了不一致,那么可能是一个缺陷导致,需要麻烦你提供一下能重现该问题的详细步骤。谢谢!

@172167396
Copy link
Author

感谢大佬百忙之中回复,今天又测试了下,有四个服务,order,providerA,providerB,bonus。入口是order服务,然后在providerB的confirm里抛出异常,大概过了几秒之后providerB执行了cancel,但是其他几个服务仍是confirm状态,不知道是不是我写的有问题,代码我压缩了一下传服务器了,能不能麻烦大佬指点下迷津,非常感谢!http://81.70.169.208/common/springboot-tcc-demo.zip

@lijiawei199
Copy link

#37 (comment)
我理解的providerB try成功 confirm失败之后应该是继续重试confirm吧? 只有try失败的时候才会cancel

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants