QNJR-GROUP / EasyTransaction

A distribute transaction solution(分布式事务) unified the usage of TCC , SAGA ,FMT (seata/fescar AutoCompensation), reliable message, compensate and so on;
Apache License 2.0
2.36k stars 809 forks source link

TCC demo 远程调用堵塞 #86

Closed laziobird closed 5 years ago

laziobird commented 5 years ago

https://github.com/QNJR-GROUP/EasyTransaction/tree/1.x/easytrans-demo Demo 似乎work不了,OrderService ,WalletService 可以正常起来,但是OrderService 127.0.0.1:8080/buySth?userId=1&money=15 远程调用WalletService,一直请求堵塞,不知道原因

skyesx commented 5 years ago

具体哪个demo?有什么报错日志?

laziobird commented 5 years ago

两个demo都是,tcc-only , rpc-dubbo.服务都正常启动,没报错,只是zookeeper 提示 Got user-level KeeperException Error:KeeperErrorCode = NodeExists,Springboot 启动日志正常,如果还不够可以沟通下 微信 nizhanali

laziobird commented 5 years ago

断点调试,执行到 OrderService
transaction.startEasyTrans(BUSINESS_CODE, id); 堵塞 如果注释掉这段,远程调用
Future deductFuture = transaction.execute(deductRequest); 堵塞

OrderService 日志 2018-10-08 19:27:40.387 INFO 15588 --- [nio-8080-exec-1] o.s.web.servlet.DispatcherServlet : FrameworkServlet 'dispatcherServlet': initialization completed in 45 ms 2018-10-08 19:27:42.067 INFO 15588 --- [nio-8080-exec-1] c.y.e.s.impl.ZooKeeperStringCodecImpl : node exists:/EasyTransStringCodec/order-service/APP_ID

WalletService 日志 2018-10-08 19:27:09.675 INFO 15603 --- [ main] o.s.j.e.a.AnnotationMBeanExporter : Registering beans for JMX exposure on startup 2018-10-08 19:27:09.699 INFO 15603 --- [ main] c.y.e.d.wallet.impl.WalletApplication : Started WalletApplication in 4.996 seconds (JVM running for 5.651)

调用没到WalletService,一直卡在 Future deductFuture = transaction.execute(deductRequest); 断点调试

skyesx commented 5 years ago

卡住了多久?一直不停?后续有没有报错?ZK和数据库有没有配置正确?

如果检查了ZK和数据库的配置都正确的话,你把完整的两个应用的日志和配置传上来看下?

我的微信可以在关注公众号后看到

laziobird commented 5 years ago

嗯,很感谢skyesx 的指导,查明原因 部署环境zookeeper 版本过低, ZooKeeper Compatibility Apache Curator is meant to be used with ZooKeeper 3.5+. However, it is also compatible with ZooKeeper 3.4.x. See Compatibility for details. 我升级ZK到3.4以后就可以了