You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@servicecomb.apache.org by GitBox <gi...@apache.org> on 2020/08/14 06:52:07 UTC

[GitHub] [servicecomb-java-chassis] liukuancn opened a new issue #1918: 优雅停机能力

liukuancn opened a new issue #1918:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1918


   请问servicecomb有提供优雅停机的能力吗,即停机前不会接入新的微服务调用,但是要等业务处理完当前正在处理的业务再停机,多谢!


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [servicecomb-java-chassis] yhs0092 commented on issue #1918: 优雅停机能力

Posted by GitBox <gi...@apache.org>.
yhs0092 commented on issue #1918:
URL: https://github.com/apache/servicecomb-java-chassis/issues/1918#issuecomment-673925432


   建议查看一下`SCBEngine#doDestroy`方法的代码,Java-Chassis 向 JVM 注册了 shutdown hook 来进行进程退出前的终止操作,称为 优雅停机。它基本符合你的描述。
   如果你想要感知服务进程退出的并做一些自定义的操作的话,可以监听`BootListener`中定义的`BEFORE_CLOSE`事件。
   
   PS:`SCBEngine#blockShutDownOperationForConsumerRefresh`方法可以在微服务进程退出时阻塞住退出线程一段时间,给 consumer 端实例留出从 sc 感知 provider 实例下线的时间。可以试用一下这个功能,看看是否适合你的部署场景。


----------------------------------------------------------------
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.

For queries about this service, please contact Infrastructure at:
users@infra.apache.org