Skip to content
Permalink
Browse files
[3.0-Triple] fix tri TheadPool is default (#10019)
  • Loading branch information
EarthChen committed May 10, 2022
1 parent d0ae161 commit b4bc7aaa664a5152c8b2cde9e50dc611ca37b9c8
Showing 3 changed files with 14 additions and 7 deletions.
@@ -38,8 +38,16 @@ public interface ExecutorRepository {
*/
ExecutorService createExecutorIfAbsent(URL url);

/**
* Be careful,The semantics of this method are getOrDefaultExecutor
*
* @param url
* @return
*/
ExecutorService getExecutor(URL url);



/**
* Modify some of the threadpool's properties according to the url, for example, coreSize, maxSize, ...
*
@@ -126,14 +126,9 @@ protected void initChannel(Channel ch) {


private Executor lookupExecutor(URL url) {
ExecutorRepository executorRepository = url.getOrDefaultApplicationModel()
return url.getOrDefaultApplicationModel()
.getExtensionLoader(ExecutorRepository.class)
.getDefaultExtension();
Executor urlExecutor = executorRepository.getExecutor(url);
if (urlExecutor == null) {
urlExecutor = executorRepository.createExecutorIfAbsent(url);
}
return urlExecutor;
.getDefaultExtension().getExecutor(url);
}

@Override
@@ -120,6 +120,10 @@ public void afterUnExport() {
triBuiltinService.getHealthStatusManager()
.setStatus(url.getServiceInterface(), HealthCheckResponse.ServingStatus.SERVING);

// init
url.getOrDefaultApplicationModel().getExtensionLoader(ExecutorRepository.class)
.getDefaultExtension()
.createExecutorIfAbsent(url);
PortUnificationExchanger.bind(invoker.getUrl());
return exporter;
}

0 comments on commit b4bc7aa

Please sign in to comment.