fix, use server attachment (#9744)

This commit is contained in:
ken.lj 2022-03-07 16:06:52 +08:00 committed by GitHub
parent 8f11fc9633
commit 58f25ebdc2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 4 deletions

View File

@ -240,9 +240,7 @@ public abstract class ReferenceConfigBase<T> extends AbstractReferenceConfig {
}
setInterface(interfaceClass == null ? null : interfaceClass.getName());
this.interfaceClass = interfaceClass;
if (getInterfaceClassLoader() == null) {
setInterfaceClassLoader(interfaceClass == null ? null : interfaceClass.getClassLoader());
}
setInterfaceClassLoader(interfaceClass == null ? null : interfaceClass.getClassLoader());
}
public String getClient() {

View File

@ -141,7 +141,7 @@ public abstract class AbstractProxyInvoker<T> implements Invoker<T> {
return (CompletableFuture<Object>) value;
} else if (RpcContext.getServerAttachment().isAsyncStarted()) {
invocation.put(PROVIDER_ASYNC_KEY, Boolean.TRUE);
return ((AsyncContextImpl) (RpcContext.getServiceContext().getAsyncContext())).getInternalFuture();
return ((AsyncContextImpl) (RpcContext.getServerAttachment().getAsyncContext())).getInternalFuture();
}
return CompletableFuture.completedFuture(value);
}