Skip to content

Commit

Permalink
[3.0-Triple] fix tri TheadPool is default (#10019)
Browse files Browse the repository at this point in the history
  • Loading branch information
EarthChen committed May 10, 2022
1 parent d0ae161 commit b4bc7aa
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 7 deletions.
Expand Up @@ -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, ...
*
Expand Down
Expand Up @@ -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
Expand Down
Expand Up @@ -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;
}
Expand Down

0 comments on commit b4bc7aa

Please sign in to comment.