ASF GitHub Bot commented on SCB-548:

zhengyangyong opened a new pull request #693: [SCB-548] support gracefully 
URL: https://github.com/apache/incubator-servicecomb-java-chassis/pull/693
   Signed-off-by: zhengyangyong <yangyong.zh...@huawei.com>
   Follow this checklist to help us incorporate your contribution quickly and 
    - [x] Make sure there is a [JIRA 
issue](https://issues.apache.org/jira/browse/SCB) filed for the change (usually 
before you start working on it).  Trivial changes like typos do not require a 
JIRA issue.  Your pull request should address just this issue, without pulling 
in other changes.
    - [x] Each commit in the pull request should have a meaningful subject line 
and body.
    - [x] Format the pull request title like `[SCB-XXX] Fixes bug in 
ApproximateQuantiles`, where you replace `SCB-XXX` with the appropriate JIRA 
    - [x] Write a pull request description that is detailed enough to 
understand what the pull request does, how, and why.
    - [x] Run `mvn clean install` to make sure basic checks pass. A more 
thorough check will be performed on your pull request automatically.
    - [x] If this contribution is large, please file an Apache [Individual 
Contributor License Agreement](https://www.apache.org/licenses/icla.pdf).
   When user call system.exit(0),these three works will do:
   1.Unregister microservice instance from Service Center:
   this work will do by process ContextClosedEvent, we need unregister 
immediately for stopping provide service any more.
   2.Waiting for all invocations to finish:
   this work will do by ShutdownHandler, when all invocations finished or 
'deadline time reached', cc and transport vertx threads will close.
   3.All spring bean do close process
   we had registerShutdownHook for spring ApplicationContext and beans can 
define 'destroy-method' do cleaning.
   here is example:
   Spring mvc Hello Java Chassis
   Pojo Hello person ServiceComb/Java Chassis
   Jaxrs Hello person ServiceComb/Java Chassis
   Spring mvc Hello person ServiceComb/Java Chassis
   2018-05-09 16:02:14,288 [WARN] handler chain is shutting down 
   2018-05-09 16:02:14,289 [INFO] Closing 
startup date [Wed May 09 16:02:05 CST 2018]; root of context hierarchy 
   2018-05-09 16:02:14,290 [WARN] cse is closing now... 
   2018-05-09 16:02:14,291 [INFO] service center task is shutdown. 
   2018-05-09 16:02:14,295 [WARN] handler chain is shut down 
   2018-05-09 16:02:14,296 [INFO] Unregister microservice instance success. 
   Process finished with exit code 0

This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:

> Support Gracefully Shutdown
> ---------------------------
>                 Key: SCB-548
>                 URL: https://issues.apache.org/jira/browse/SCB-548
>             Project: Apache ServiceComb
>          Issue Type: Improvement
>          Components: Java-Chassis
>    Affects Versions: java-chassis-1.0.0-m2
>            Reporter: yangyongzheng
>            Assignee: yangyongzheng
>            Priority: Major
>             Fix For: java-chassis-1.0.0-m2
> We did not implement gracefully shutdown yet: 
> ```java
>           // 当程序退出时,进行相关清理,注意:kill -9 {pid}下无效
>           // 1. 去注册实例信息
>           // TODO 服务优雅退出
>           if (applicationContext instanceof AbstractApplicationContext) {
>             ((AbstractApplicationContext) 
> applicationContext).registerShutdownHook();
>           }
> ```
>   And had got an issue : 
> https://github.com/apache/incubator-servicecomb-java-chassis/issues/685 from 
> user.
>   So it's time we must do it and remove this TODO

This message was sent by Atlassian JIRA

Reply via email to