zrlw edited a comment on issue #9079:
URL: https://github.com/apache/dubbo/issues/9079#issuecomment-955664729
现在ServiceConfigTest.testDelayExport第222行抛RejectedExecution:
```
Error: org.apache.dubbo.config.ServiceConfigTest.testDelayExport Time
elapsed: 0.351 s <<< ERROR!
java.util.concurrent.RejectedExecutionException: Task
java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask@33a910c5
rejected from
java.util.concurrent.ScheduledThreadPoolExecutor@2e7c932c[Terminated, pool size
= 0, active threads = 0, queued tasks = 0, completed tasks = 0]
at
org.apache.dubbo.config.ServiceConfigTest.testDelayExport(ServiceConfigTest.java:222)
```
github构建也经常遇到,比如:
https://github.com/apache/dubbo/runs/4058917480?check_suite_focus=true
https://github.com/apache/dubbo/runs/4058917494?check_suite_focus=true
根源是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,获取方法的同步机制有缺陷。
#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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]