Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.0-SNAPSHOT

Step to reproduce this issue

https://github.com/apache/incubator-dubbo/blob/master/dubbo-registry/dubbo-registry-api/src/main/java/org/apache/dubbo/registry/integration/RegistryProtocol.java

private URL getRegisteredProviderUrl(final Invoker<?> originInvoker) {
URL providerUrl = getProviderUrl(originInvoker);
//The address you see at the registry
return providerUrl.removeParameters(getFilteredKeys(providerUrl))
.removeParameter(Constants.MONITOR_KEY)
.removeParameter(Constants.BIND_IP_KEY)
.removeParameter(Constants.BIND_PORT_KEY)
.removeParameter(QOS_ENABLE)
.removeParameter(QOS_PORT)
.removeParameter(ACCEPT_FOREIGN_IP)
.removeParameter(VALIDATION_KEY)
.removeParameter(INTERFACES);
}
TO
private URL getRegisteredProviderUrl(final Invoker<?> originInvoker) {
URL providerUrl = getProviderUrl(originInvoker);
// 此处移除async标记，仅保留标记在provider端
Set<String> keySet = providerUrl.getParameters().keySet();
List<String> asyncKey = new ArrayList<>();
for(String key : keySet) {
if(key.endsWith("." + Constants.ASYNC_KEY) || key.equals(Constants.ASYNC_KEY)) {
asyncKey.add(key);
}
}
//The address you see at the registry
return providerUrl.removeParameters(getFilteredKeys(providerUrl))
.removeParameter(Constants.MONITOR_KEY)
.removeParameter(Constants.BIND_IP_KEY)
.removeParameter(Constants.BIND_PORT_KEY)
.removeParameter(QOS_ENABLE)
.removeParameter(QOS_PORT)
.removeParameter(ACCEPT_FOREIGN_IP)
.removeParameter(VALIDATION_KEY)
.removeParameter(INTERFACES)
.removeParameters(asyncKey);
}

that if Provider use "provider async" like this：

public String sayHello(String name) {
System.out.println("Main sayHello() method start.");
final AsyncContext asyncContext = RpcContext.startAsync();
new Thread(() -> {
asyncContext.signalContextSwitch();
System.out.println("Attachment from consumer: " + RpcContext.getContext().getAttachment("consumer-key1"));
System.out.println(" -- Async start.");
try {
Thread.sleep(500);
} catch (InterruptedException e) {
e.printStackTrace();
}
asyncContext.write("Hello " + name + ", response from provider.");
System.out.println(" -- Async end.");
}).start();
System.out.println("Main sayHello() method end.");
return "hello, " + name;
}
<dubbo:method name="sayHello" async="true"/>

and consumer user dubbo version low than 2.7.0-SNAPSHOT,

"async = true" will know from provider registed url, that need consumer use old async to invoke this method. But it is not what we expected, we think async should only be set by consumer itself.

英文不太好，中文版：

Provider版本使用 2.7.0-SNAPSHOT版本，然后发布接口使用了"provider async"的方式（见上面第二段代码）,则需要在发布的时候添加 <dubbo:method name="sayHello" async="true"/>则会将 async=true 的标记注册到注册中心，这时候就会将标记透传到 Consumer 端，导致服务调用变成异步的，而出现返回值为 null 的情况。

根据我个人的理解，async 标记应该仅由 provider 或 consumer 自己指定，而不应该透传到对方感知。

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.3

Operating System version: MacOS Catalina 10.15 Beta

Java version: 1.8

project struct

DubboConfiguration

@Configuration
@EnableDubbo(scanBasePackages = "com.weiguang.www.dubboprovider.service")
@PropertySource(value = "classpath:dubbo-provider.properties")
public class DubboConfiguration {

@Bean
public ProviderConfig providerConfig(){
ProviderConfig providerConfig = new ProviderConfig();
providerConfig.setTimeout(3000);
return providerConfig;
}

}

log

[DUBBO] No Spring Bean annotating Dubbo's @Service was found under package[com.weiguang.www.dubboconsumer.config], dubbo version: 2.7.3, current host: 192.168.1.111

搜索的是config文件所在的目录，并不是 @EnableDubbo(scanBasePackages = "com.weiguang.www.dubboprovider.service") 指定的目录。

导致在zookeeper中,provider内容为空，

[zk: 127.0.0.1:2181(CONNECTED) 0] ls /
[dubbo, zookeeper]
[zk: 127.0.0.1:2181(CONNECTED) 1] ls /dubbo
[com.weiguang.www.dubbointerface.service.HelloService]
[zk: 127.0.0.1:2181(CONNECTED) 2] ls /dubbo/com.weiguang.www.dubbointerface.service.HelloService
[configurators, consumers, providers, routers]
[zk: 127.0.0.1:2181(CONNECTED) 3] ls /dubbo/com.weiguang.www.dubbointerface.service.HelloService/providers
[]
[zk: 127.0.0.1:2181(CONNECTED) 4]

最终导致consumer 调用时出现 No provider availabe 错误:

"timestamp": "2019-07-30T02:39:07.740+0000",
"status": 500,
"error": "Internal Server Error",
"message": "No provider available from registry 127.0.0.1:2181 for service com.weiguang.www.dubbointerface.service.HelloService:1.0.0 on consumer 192.168.1.111 use dubbo version 2.7.3, please check status of providers(disabled, not registered or in blacklist).",
"path": "/hello"

解决方法：

需要在configuration类上加注解 @DubboComponentScan(basePackages = "com.weiguang.www.dubboprovider.service") ，service才会被注册。