incubator-seata
incubator-seata copied to clipboard
initialization deadlock when startup
- [ ] I have searched the issues of this repository and believe that this is not a duplicate.
Ⅰ. Issue Description
启动时如果数据库加载过久会hang住,此时在jstack看到的现象是有等待,但没有死锁,但实际上这个跟死锁效果一样。 这个文章有提到 https://stackoverflow.com/questions/28631656/runnable-thread-state-but-in-object-wait
之前的死锁问题在https://github.com/seata/seata/pull/4107 有解决,但现在看来这个方案因为涉及静态加载也会变成另一种死锁
Ⅱ. Describe what happened
If there is an exception, please attach the exception trace:


Ⅲ. Describe what you expected to happen
期望效果是不要死锁,其实我觉得timeout线程可以不去加载这个工厂
Ⅳ. How to reproduce it (as minimally and precisely as possible)
我的预想是timeout线程永远不要主动去加载registryFactory,因为启动主线程是一定会加载的,他只要等就可以了
实现类似下面
Ⅴ. Anything else we need to know?
Ⅵ. Environment:
- JDK version : 8
- Seata version: 1.4.2(且已经按照https://github.com/seata/seata/pull/4107 改过 )
- OS :
- Others: