Issue 1:
the problem has occured two times, however the program could resume after restarting.

[ X ] I have searched the issues of this repository and believe that this is not a duplicate.

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

Environment

Dubbo version: 2.6.0

Operating System version: CentOS 6.9 kernel 2.6.32

Java version: 1.8.0_51-b16

HEAP DUMP ANALYSIS

The classloader/component "sun.misc.Launcher$AppClassLoader @ 0xc00009e0" occupies 218,169,664 (20.50%) bytes. The memory is accumulated in one instance of "java.lang.Object[]" loaded by "".

Class Name
Shallow Heap
Retained Heap

java.util.concurrent.ConcurrentHashMap$Node[65536] @ 0xef72bd20
262,160
206,175,368

table java.util.concurrent.ConcurrentHashMap @ 0xc1caa0f0
64
206,175,432

notified com.alibaba.dubbo.registry.zookeeper.ZookeeperRegistry @ 0xc0e90f00
104
287,488,568

this$0 com.alibaba.dubbo.registry.support.FailbackRegistry$1 @ 0xc0e91130
16
16

task java.util.concurrent.Executors$RunnableAdapter @ 0xc0e91118
24
40

java.lang.Thread @ 0xc0737418 DubboRegistryFailedRetryTimer-thread-1 Thread
120
472

callable java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask @ 0xc0e910d0 »
72
72

Total: 2 entries

registry com.alibaba.dubbo.registry.integration.RegistryDirectory @ 0xc1961620 »
80
3,328

val$registry com.alibaba.dubbo.registry.integration.RegistryProtocol$1 @ 0xc1498860 »
40
40

val$registry com.alibaba.dubbo.registry.integration.RegistryProtocol$1 @ 0xc165e460 »
40
40

val$registry com.alibaba.dubbo.registry.integration.RegistryProtocol$1 @ 0xc1d449b8 »
40
40

val$registry com.alibaba.dubbo.registry.integration.RegistryProtocol$1 @ 0xc25720b8 »
40
40

Total: 6 entries

SOME THREAD STACK

com.alibaba.dubbo.rpc.RpcException: No provider available from registry 172.16.0.128:2181 for service **SERVICE NAME HERE** on consumer 172.16.0.128 use dubbo version 2.6.0, may be providers disabled or not registered ?
at com.alibaba.dubbo.registry.integration.RegistryDirectory.doList(RegistryDirectory.java:572) ~[dubbo-2.6.0.jar:2.6.0]
at com.alibaba.dubbo.rpc.cluster.directory.AbstractDirectory.list(AbstractDirectory.java:73) ~[dubbo-2.6.0.jar:2.6.0]
at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.list(AbstractClusterInvoker.java:265) ~[dubbo-2.6.0.jar:2.6.0]
at com.alibaba.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:224) ~[dubbo-2.6.0.jar:2.6.0]
at com.alibaba.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:70) ~[dubbo-2.6.0.jar:2.6.0]
at com.alibaba.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:51) ~[dubbo-2.6.0.jar:2.6.0]
at com.alibaba.dubbo.common.bytecode.proxy7.queryId(proxy7.java) ~[dubbo-2.6.0.jar:2.6.0]

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.1

Operating System version: Win 10

Java version: 1.8

Steps to reproduce this issue

Consuner and provider in the same machine, use MulticastRegistry,

consumer.xml

<dubbo:registry protocol="multicast" address="224.5.6.7:1234">
<dubbo:parameter key="unicast" value="false" />
</dubbo:registry

Pls. provide [GitHub address] to reproduce this issue.

Expected Result

Consuner and provider in the same machine, use MulticastRegistry, Call Success

Actual Result

I found a similar problem

#3401 Consumer call failed with MulticastRegistry when consuner and provider in the same machine

I guess : the producer's unicast message is accepted by itself when use MulticastRegistr and consumer parameter unicast is true . So I tried change unicast to flase, But the message sent by the consumer to the producer does not have this parameter.

I'm not sure this is a bug.

I tried to modify it like below, but i feel too coupled.

package org.apache.dubbo.registry.integration;

public class package org.apache.dubbo.registry.integration;<T> extends AbstractDirectory<T> implements NotifyListener {
...
private URL turnRegistryUrlToConsumerUrl(URL url) {
// save any parameter in registry that will be useful to the new url.
String isDefault = url.getParameter(Constants.DEFAULT_KEY);
if (StringUtils.isNotEmpty(isDefault)) {
queryMap.put(Constants.REGISTRY_KEY + "." + Constants.DEFAULT_KEY, isDefault);
}
+ String unicast = url.getParameter("unicast");
+ if (StringUtils.isNotEmpty(unicast)) {
+ queryMap.put("unicast", unicast);
+ }
return URLBuilder.from(url)
.setPath(url.getServiceInterface())
.clearParameters()
.addParameters(queryMap)
.removeParameter(Constants.MONITOR_KEY)
.build();
}
......
}

If there is an exception, please attach the exception trace:

2019-05-23 16:50:51:445 INFO [main,DubboBaseRegistry,org.apache.dubbo.registry.support.AbstractRegistry,261]: [DUBBO] Register: consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=consumers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:51:448 INFO [main,DubboBaseRegistry,org.apache.dubbo.registry.multicast.MulticastRegistry,216]: [DUBBO] Send multicast message: register consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=consumers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941 to /224.5.6.7:1234, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:51:449 INFO [DubboMulticastRegistryReceiver,DubboBaseRegistry,org.apache.dubbo.registry.multicast.MulticastRegistry,186]: [DUBBO] Receive multicast message: register consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=consumers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941 from /127.0.0.1:1234, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:51:460 INFO [main,DubboBaseRegistry,org.apache.dubbo.registry.support.AbstractRegistry,286]: [DUBBO] Subscribe: consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:51:461 INFO [main,DubboBaseRegistry,org.apache.dubbo.registry.multicast.MulticastRegistry,216]: [DUBBO] Send multicast message: subscribe consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941 to /224.5.6.7:1234, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:51:463 INFO [DubboMulticastRegistryReceiver,DubboBaseRegistry,org.apache.dubbo.registry.multicast.MulticastRegistry,186]: [DUBBO] Receive multicast message: subscribe consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941 from /127.0.0.1:1234, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:468 WARN [main,DubboBaseRegistry,org.apache.dubbo.registry.support.AbstractRegistry,376]: [DUBBO] Ignore empty notify urls for subscribe url consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:471 INFO [main,DubboBaseRegistry,org.apache.dubbo.config.ReferenceConfig,393]: [DUBBO] Refer dubbo service cn.xhb.dubbo.sample.base.service.HelloService from url multicast://224.5.6.7:1234/org.apache.dubbo.registry.RegistryService?application=dubbo-base-consumer&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&register.ip=192.168.5.58&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941, dubbo version: 2.7.1, current host: 192.168.5.58
Exception in thread "main" org.apache.dubbo.rpc.RpcException: Failed to invoke the method sayHello in the service cn.xhb.dubbo.sample.base.service.HelloService. No provider available for the service cn.xhb.dubbo.sample.base.service.HelloService from registry 224.5.6.7:1234 on the consumer 192.168.5.58 using the dubbo version 2.7.1. Please check if the providers have been started and registered.
at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.checkInvokers(AbstractClusterInvoker.java:265)
at org.apache.dubbo.rpc.cluster.support.FailoverClusterInvoker.doInvoke(FailoverClusterInvoker.java:57)
at org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker.invoke(AbstractClusterInvoker.java:242)
at org.apache.dubbo.rpc.cluster.support.wrapper.MockClusterInvoker.invoke(MockClusterInvoker.java:76)
at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:57)
at org.apache.dubbo.common.bytecode.proxy0.sayHello(proxy0.java)
at cn.xhb.dubbo.sample.base.Consumer.main(Consumer.java:14)
2019-05-23 16:50:52:487 INFO [Thread-0,DubboBaseRegistry,org.springframework.context.support.AbstractApplicationContext,984]: Closing org.springframework.context.support.ClassPathXmlApplicationContext@73a8dfcc: startup date [Thu May 23 16:50:50 CST 2019]; root of context hierarchy
2019-05-23 16:50:52:488 INFO [Thread-0,DubboBaseRegistry,org.apache.dubbo.registry.support.AbstractRegistryFactory,65]: [DUBBO] Close all registries [multicast://224.5.6.7:1234/org.apache.dubbo.registry.RegistryService?application=dubbo-base-consumer&dubbo=2.0.2&interface=org.apache.dubbo.registry.RegistryService&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&timestamp=1558601450968&unicast=false], dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:488 INFO [Thread-0,DubboBaseRegistry,org.apache.dubbo.registry.support.AbstractRegistry,439]: [DUBBO] Destroy registry:multicast://224.5.6.7:1234/org.apache.dubbo.registry.RegistryService?application=dubbo-base-consumer&dubbo=2.0.2&interface=org.apache.dubbo.registry.RegistryService&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&timestamp=1558601450968&unicast=false, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:488 INFO [Thread-0,DubboBaseRegistry,org.apache.dubbo.registry.support.AbstractRegistry,272]: [DUBBO] Unregister: consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=consumers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:488 INFO [Thread-0,DubboBaseRegistry,org.apache.dubbo.registry.multicast.MulticastRegistry,216]: [DUBBO] Send multicast message: unregister consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=consumers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941 to /224.5.6.7:1234, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:488 INFO [Thread-0,DubboBaseRegistry,org.apache.dubbo.registry.support.AbstractRegistry,448]: [DUBBO] Destroy unregister url consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=consumers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:488 INFO [DubboMulticastRegistryReceiver,DubboBaseRegistry,org.apache.dubbo.registry.multicast.MulticastRegistry,186]: [DUBBO] Receive multicast message: unregister consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=consumers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941 from /127.0.0.1:1234, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:496 INFO [Thread-0,DubboBaseRegistry,org.apache.dubbo.registry.support.AbstractRegistry,301]: [DUBBO] Unsubscribe: consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:496 INFO [Thread-0,DubboBaseRegistry,org.apache.dubbo.registry.support.AbstractRegistry,272]: [DUBBO] Unregister: consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:497 INFO [Thread-0,DubboBaseRegistry,org.apache.dubbo.registry.multicast.MulticastRegistry,216]: [DUBBO] Send multicast message: unregister consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941 to /224.5.6.7:1234, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:498 INFO [DubboMulticastRegistryReceiver,DubboBaseRegistry,org.apache.dubbo.registry.multicast.MulticastRegistry,186]: [DUBBO] Receive multicast message: unregister consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941 from /127.0.0.1:1234, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:499 INFO [Thread-0,DubboBaseRegistry,org.apache.dubbo.registry.multicast.MulticastRegistry,216]: [DUBBO] Send multicast message: unsubscribe consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941 to /224.5.6.7:1234, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:499 INFO [DubboMulticastRegistryReceiver,DubboBaseRegistry,org.apache.dubbo.registry.multicast.MulticastRegistry,186]: [DUBBO] Receive multicast message: unsubscribe consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941 from /127.0.0.1:1234, dubbo version: 2.7.1, current host: 192.168.5.58
2019-05-23 16:50:52:499 INFO [Thread-0,DubboBaseRegistry,org.apache.dubbo.registry.support.AbstractRegistry,464]: [DUBBO] Destroy unsubscribe url consumer://192.168.5.58/cn.xhb.dubbo.sample.base.service.HelloService?application=dubbo-base-consumer&category=providers,configurators,routers&check=false&default.lazy=false&default.sticky=false&dubbo=2.0.2&interface=cn.xhb.dubbo.sample.base.service.HelloService&lazy=false&methods=sayHello&pid=23664&qos.accept.foreign.ip=false&qos.enable=true&qos.port=33333&release=2.7.1&side=consumer&sticky=false&timestamp=1558601450941, dubbo version: 2.7.1, current host: 192.168.5.58