-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Dubbo 2.7.0的provider无法指定客户端默认async #3650
Comments
This is a normal result. I don't think this is a problem. Do u have any questions about it? |
Once provider upgrade to 2.7.0, invoke be changed from async to sync, that means client cannot get result from context future. Also, what will the async config for in provider side? |
I don't get your point.. Why does upgrading to 2.7 change from synchronous to asynchronous?
|
Provider 2.5.x, consumer 2.5.x, provider specific async, consumer keeps default. For consumer, they have to get value from RpcContext. Provider 2.7.0, consumer 2.5.x, provider speicif async, consumer keeps default. For consumer, the value form RpcContext is null, this is incompatible. |
Got it. In the new version (2.7.x), the asynchronous of the provider and consumer is isolated. However, in the old version, consumer asynchronous and provider asynchronous are still bound. Is this situation considered? @chickenlj Maybe it is a problem that we need to fix. |
Is provider async redundancy as we are able to return CompletableFuture? It's sync for provider. It's async for provider. |
AsyncContext is mainly designed for |
Provider should not be configured to allow async, user should be able to decide they want async or sync when programming without any precondition, that's what Dubbo guaranteed now. So I think what we should do is to remove |
For async, it's reasonable to remove it from dubbo:service/. But, are we going to remove timeout and retries also? Provider should be clear about the timeout and idempotency, then consumer. For these two keys should be kept, provider should have default values for consumer. |
都是中国人在用,为啥总是说英文,散装英语不如直接写中文啊 |
Environment
Steps to reproduce this issue
Pls. provide [GitHub address] to reproduce this issue.
Expected Result
What do you expected from the above steps?
We are able to get the value from the CompletableFuture.
service.sayHello(input);
CompletableFuture future = RpcContext.getContext().getCompletableFuture();
future.whenComplete((retValue, error) -> {
System.out.println(retValue);
});
Actual Result
What actually happens?
It throws NPE exception as following, as we are not able to get the future.
Exception in thread "main" java.lang.NullPointerException
With investigation, it's an issue in RegistryDirectory.
Also, we are able to get async=true from providerUrl, but the querymap's async is false from consumer side. It changed the async from true to false, and caused the issue.
private URL mergeUrl(URL providerUrl) {
providerUrl = ClusterUtils.mergeUrl(providerUrl, queryMap);
}
If there is an exception, please attach the exception trace:
The text was updated successfully, but these errors were encountered: