fix bug lazy client share_executor is null (#9701)

This commit is contained in:
Owen.Cai 2022-02-25 16:53:12 +08:00 committed by GitHub
parent 5bc4e91338
commit ed2c2ad7eb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 3 additions and 0 deletions

View File

@ -197,6 +197,9 @@ public abstract class AbstractInvoker<T> implements Invoker<T> {
protected ExecutorService getCallbackExecutor(URL url, Invocation inv) {
ExecutorService sharedExecutor = ExtensionLoader.getExtensionLoader(ExecutorRepository.class).getDefaultExtension().getExecutor(url);
if (InvokeMode.SYNC == RpcUtils.getInvokeMode(getUrl(), inv)) {
if(sharedExecutor == null) {
sharedExecutor = ExtensionLoader.getExtensionLoader(ExecutorRepository.class).getDefaultExtension().getSharedExecutor();
}
return new ThreadlessExecutor(sharedExecutor);
} else {
return sharedExecutor;