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/03/02 07:17:43 UTC

[GitHub] [servicecomb-java-chassis] WellaceZ opened a new issue #1606: servicecomb可否定制全部的Handler?&servicecomb退出时为何会关闭非守护线程?

WellaceZ opened a new issue #1606: servicecomb可否定制全部的Handler?&servicecomb退出时为何会关闭非守护线程?
URL: https://github.com/apache/servicecomb-java-chassis/issues/1606
 
 
   有两个问题咨询下:
   1.SCBEngine在进行初始化时,会进行ProducerProvider的初始化
   ![image](https://user-images.githubusercontent.com/53045286/75648705-d3180e00-5c8b-11ea-9621-97a4a2868cdb.png)
   可以看到框架指定了最后一个Handler——ProducerOperationHandler,这个Handler作用就是为了进行validator检验的吗?我可否不使用这个Handler?
   
   2.我在自定义的BootListener监听器中,监听了BEFORE_CLOSE事件:
   public abstract class AppShutdownBootListener implements BootListener {
       public void onBootEvent(BootEvent bootEvent) {
           switch(bootEvent.getEventType()) {
           case BEFORE_CLOSE:
               this.onBeforeClose();
               break;
           default:
               return;
           }
       }
       private void onBeforeClose() {
           LOGGER.debug("before close event start");
           this.thread = new Thread(() -> {
              ......
           }, "GroupExecutor-monitor-thread");
           this.thread.setDaemon(false);
           this.thread.start();
       }
   }
   在这个事件中,我开启了一个非守护线程,但是为何随着ServiceComb的JVM钩子线程的结束,进程就退出了,jvm不是会等待所有的非守护线程结束吗,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


With regards,
Apache Git Services