yhs0092 opened a new issue, #3960:
URL: https://github.com/apache/servicecomb-java-chassis/issues/3960
## 问题现象
业务进程发生OOM后, 我们会使用`kill`命令触发JVM优雅停机. 退出流程中触发了Java-Chassis的shutdown hook,
最终会走到`SCBEngine#doDestroy`方法执行 Java-Chassis 各组件的销毁操作. 我们发现这一方法偶尔会发生阻塞, 停顿在
`VertxUtils.blockCloseVertxByName("transport");` 这一行, 导致JVM无法正常退出, 业务无法重启.
原因是`VertxUtils.blockCloseVertxByName`方法内的`future.get()`方法没有设置超时时间,
jstack观察到shutdown hook线程一直卡在这个位置:
```java
public static void blockCloseVertxByName(String name) {
CompletableFuture<Void> future = closeVertxByName(name);
try {
future.get(); // <---- 线程阻塞位置
} catch (Throwable e) {
LOGGER.error("Failed to wait close vertx {}.", name, e);
}
}
```
## 期望
建议在`future.get()`方法调用里设置等待超时时间, 避免长时间阻塞退出流程.
## Java-Chassis 版本
1.3.11
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]