smalljunHw commented on issue #3918:
URL: 
https://github.com/apache/servicecomb-java-chassis/issues/3918#issuecomment-1783740581

   > 我在2.6.0版本实现了一个listener,监听AFTER_REGISTRY,监听到该事件,执行一些逻辑后,抛出异常会导致服务进程挂掉
   
你可以先让注册中心连不上,待启动流程完成后,再让注册中心恢复,此时监听AFTER_REGISTRY事件的BootListener就会在心跳线程中执行,抛异常不会导致进程挂掉。
   
因为CSE先在main线程的启动流程中尝试向注册中心注册微服务实例,如果启动流程中注册成功了,那AFTER_REGISTRY事件的BootListener就在main线程执行,如果抛异常会导致启动失败;如果启动流程中微服务实例未注册成功,则会在心跳线程中继续尝试进行微服务实例注册,AFTER_REGISTRY事件的BootListener也在这个线程中执行,如果抛异常,不会导致启动失败,会产生所说的问题


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

Reply via email to