kylixs commented on issue #9079:
URL: https://github.com/apache/dubbo/issues/9079#issuecomment-951884089
>
destroy需要加上ServiceInstancesChangedListener的destroy,否则AddressRefreshRetryTask会一直运行,导致后续测试类执行失败:
从代码来看,scheduler使用了Application的ExecutorRepository,这个组件会在应用关闭时shutdown
所持有的ExecutorService资源,不应该会一直执行。可以打开线程检查看一下是否所有线程被清理。
```
mvn test -DcheckThreads=true
```
```java
...
this.scheduler = ScopeModelUtil.getApplicationModel(serviceDiscovery
== null || serviceDiscovery.getUrl() == null ? null :
serviceDiscovery.getUrl().getScopeModel())
.getExtensionLoader(ExecutorRepository.class).getDefaultExtension().getMetadataRetryExecutor();
...
if (hasEmptyMetadata(newRevisionToMetadata)) {// retry every 10
seconds
if (retryPermission.tryAcquire()) {
retryFuture = scheduler.schedule(new
AddressRefreshRetryTask(retryPermission, event.getServiceName()), 10_000L,
TimeUnit.MILLISECONDS);
logger.warn("Address refresh try task submitted.");
}
logger.error("Address refresh failed because of Metadata Server
failure, wait for retry or new address refresh event.");
return;
}
...
```
--
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]