You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by GitBox <gi...@apache.org> on 2021/10/31 06:41:14 UTC

[GitHub] [dubbo] zrlw opened a new issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

zrlw opened a new issue #9168:
URL: https://github.com/apache/dubbo/issues/9168


   ### Environment
   
   * Dubbo version: 3.0
   近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException
   ```
   2021-10-31T04:49:31.2886119Z [ERROR] Tests run: 22, Failures: 0, Errors: 1, Skipped: 1, Time elapsed: 5.179 s <<< FAILURE! - in org.apache.dubbo.config.ServiceConfigTest
   2021-10-31T04:49:31.2887925Z [ERROR] org.apache.dubbo.config.ServiceConfigTest.testDelayExport  Time elapsed: 0.298 s  <<< ERROR!
   2021-10-31T04:49:31.2890996Z java.util.concurrent.RejectedExecutionException: Task java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@7f9df7e rejected from java.util.concurrent.ScheduledThreadPoolExecutor@b05ceb9[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]
   2021-10-31T04:49:31.2894094Z 	at org.apache.dubbo.config.ServiceConfigTest.testDelayExport(ServiceConfigTest.java:222)
   ```
   看了代码,第222行就是```delayService.export();```,什么情况下这行代码会触发线程池拒绝执行异常?
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-958787315


   debug确认了问题原因,DefaultApplicationDeployer的onStarted方法和ServiceConfigTest的testDelayExport方法的delayService.export()在两个线程里并行执行所致。
   当delayService.export()先调用DefaultExecutorRepository的getServiceExportExecutor创建了serviceExportExecutor之后,
   DefaultApplicationDeployer的onStarted方法马上执行了executorRepository.shutdownServiceExportExecutor()关闭了serviceExportExecutor,导致ServiceConfigTest的testDelayExport方法使用了shutdown的executor。


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-958787315


   debug确认了问题原因,DefaultApplicationDeployer的onStarted方法和ServiceConfigTest的testDelayExport方法的delayService.export()在两个线程里并行执行所致。
   当delayService.export()先调用DefaultExecutorRepository的getServiceExportExecutor创建了serviceExportExecutor之后,
   DefaultApplicationDeployer的onStarted方法马上执行了executorRepository.shutdownServiceExportExecutor()关闭了serviceExportExecutor,导致ServiceConfigTest的testDelayExport方法使用了shutdown的executor。


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-955678243


   是ServiceConfig的doDelayExport()方法执行时抛出的异常:
   ```
       protected void doDelayExport() {
           getScopeModel().getDefaultExtension(ExecutorRepository.class).getServiceExportExecutor()
               .schedule(() -> {
                   try {
                       doExport();
                   } catch (Exception e) {
                       logger.error("Failed to export service config: " + interfaceName, e);
                   }
               }, getDelay(), TimeUnit.MILLISECONDS);
       }
   ```
   可能是getServiceExportExecutor获取到的executor正在做shutdown,获取方法的同步机制有缺陷。
   不过我觉得DefaultExecutorRepository的serviceExportExecutor的scope应该改成framework,不应该随着每个application进行shutdown。


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-955678243


   是ServiceConfig的doDelayExport()方法执行时抛出的异常:
   ```
       protected void doDelayExport() {
           getScopeModel().getDefaultExtension(ExecutorRepository.class).getServiceExportExecutor()
               .schedule(() -> {
                   try {
                       doExport();
                   } catch (Exception e) {
                       logger.error("Failed to export service config: " + interfaceName, e);
                   }
               }, getDelay(), TimeUnit.MILLISECONDS);
       }
   ```
   可能是MultiInstanceTest.testAsyncExportAndReferServices导致的,MultiInstanceTest有线程泄露


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-958787315


   debug确认了问题原因,DefaultApplicationDeployer的onStarted方法和ServiceConfigTest的testDelayExport方法的delayService.export()在两个线程里并行执行所致。
   当delayService.export()先调用DefaultExecutorRepository的getServiceExportExecutor创建了serviceExportExecutor之后,
   DefaultApplicationDeployer的onStarted方法马上执行了executorRepository.shutdownServiceExportExecutor()关闭了serviceExportExecutor,导致ServiceConfigTest的testDelayExport方法使用了shutdown的executor。


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw closed issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
zrlw closed issue #9168:
URL: https://github.com/apache/dubbo/issues/9168


   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-955696029


   #9015 试着改了一下getServiceExportExecutor,把同步锁提前到了方法入口,目前看这么修改是有效的,无论本机构建还是github构建,这个问题尚未再出现过。
   初步分析是ServiceConfigTest的代码执行顺序发生了重排,导致修改前的getServiceExportExecutor返回了正在做shutdown的executor。
   


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-955678243


   是ServiceConfig的doDelayExport()方法执行时抛出的异常:
   ```
       protected void doDelayExport() {
           getScopeModel().getDefaultExtension(ExecutorRepository.class).getServiceExportExecutor()
               .schedule(() -> {
                   try {
                       doExport();
                   } catch (Exception e) {
                       logger.error("Failed to export service config: " + interfaceName, e);
                   }
               }, getDelay(), TimeUnit.MILLISECONDS);
       }
   ```
   可能是MultiInstanceTest导致的,MultiInstanceTest有线程泄露


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] kylixs commented on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
kylixs commented on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-955702625


   > 什么情况下这行代码会触发线程池拒绝执行异常?
   
   See:  `ScheduledThreadPoolExecutor@b05ceb9[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]`
   
   The message told us:  the `ScheduledThreadPoolExecutor` is terminated, so reject all submit job.
   
   Perhaps the application of delayService has been closed before export. 


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-955678243


   是ServiceConfig的doDelayExport()方法执行时抛出的异常:
   ```
       protected void doDelayExport() {
           getScopeModel().getDefaultExtension(ExecutorRepository.class).getServiceExportExecutor()
               .schedule(() -> {
                   try {
                       doExport();
                   } catch (Exception e) {
                       logger.error("Failed to export service config: " + interfaceName, e);
                   }
               }, getDelay(), TimeUnit.MILLISECONDS);
       }
   ```


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] kylixs edited a comment on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
kylixs edited a comment on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-955702625


   > 什么情况下这行代码会触发线程池拒绝执行异常?
   
   See:  `ScheduledThreadPoolExecutor@b05ceb9[Terminated, pool size = 0, active threads = 0, queued tasks = 0, completed tasks = 0]`
   
   The message told us:  the `ScheduledThreadPoolExecutor` is terminated, so reject all submit job.
   
   Perhaps the application of delayService has been closed before exec export job. 


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw edited a comment on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
zrlw edited a comment on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-955678243


   是ServiceConfig的doDelayExport()方法执行时抛出的异常:
   ```
       protected void doDelayExport() {
           getScopeModel().getDefaultExtension(ExecutorRepository.class).getServiceExportExecutor()
               .schedule(() -> {
                   try {
                       doExport();
                   } catch (Exception e) {
                       logger.error("Failed to export service config: " + interfaceName, e);
                   }
               }, getDelay(), TimeUnit.MILLISECONDS);
       }
   ```
   可能是getServiceExportExecutor获取到的executor正在做shutdown,获取方法的同步机制有缺陷。


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org


[GitHub] [dubbo] zrlw commented on issue #9168: [3.0] 近期github构建经常提示ServiceConfigTest.testDelayExport第222行抛RejectedExecutionException

Posted by GitBox <gi...@apache.org>.
zrlw commented on issue #9168:
URL: https://github.com/apache/dubbo/issues/9168#issuecomment-958787315


   debug确认了问题原因,DefaultApplicationDeployer的onStarted方法和ServiceConfigTest的testDelayExport方法的delayService.export()在两个线程里并行执行所致。
   当delayService.export()先调用DefaultExecutorRepository的getServiceExportExecutor创建了serviceExportExecutor之后,
   DefaultApplicationDeployer的onStarted方法马上执行了executorRepository.shutdownServiceExportExecutor()关闭了serviceExportExecutor,导致ServiceConfigTest的testDelayExport方法使用了shutdown的executor。


-- 
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: notifications-unsubscribe@dubbo.apache.org

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



---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@dubbo.apache.org
For additional commands, e-mail: notifications-help@dubbo.apache.org