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

Operating System version: all

Java version: all

Steps to reproduce this issue

start a dubbo provider with service group="1.0.0"

start a dubbo generic consumer with referenceConfig.setGroup("1.0.0")

call genericService.$invoke

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

Expected Result

success return.

Actual Result

not found exported service,may be version or group mismatch.

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

Exception in thread "main" org.apache.dubbo.rpc.RpcException: Failed to invoke remote method: $invoke, provider: dubbo://127.0.0.1:20890/org.apache.dubbo.samples.context.api.ContextService?application=generic-call-consumer&dubbo=2.0.2&generic=true&group=&interface=org.apache.dubbo.samples.context.api.ContextService&pid=13296&register.ip=x.x.x.x&side=consumer&timestamp=1551067201057, cause: org.apache.dubbo.remoting.RemotingException: Not found exported service: org.apache.dubbo.samples.context.api.ContextService:20890 in [1.0.0/org.apache.dubbo.samples.context.api.ContextService:20890], may be version or group mismatch , channel: consumer: /x.x.x.x:43004 --> provider: /x.x.x.x:20890, message:RpcInvocation [methodName=$invoke, parameterTypes=[class java.lang.String, class [Ljava.lang.String;, class [Ljava.lang.Object;], arguments=[sayHello, [Ljava.lang.String;@42f5a7d7, [Ljava.lang.Object;@4c3251f9], attachments={path=org.apache.dubbo.samples.context.api.ContextService, input=342, dubbo=2.0.2, interface=org.apache.dubbo.samples.context.api.ContextService, version=0.0.0, generic=true}]
org.apache.dubbo.remoting.RemotingException: Not found exported service: org.apache.dubbo.samples.context.api.ContextService:20890 in [1.0.0/org.apache.dubbo.samples.context.api.ContextService:20890], may be version or group mismatch , channel: consumer: /x.x.x.x:43004 --> provider: /x.x.x.x:20890, message:RpcInvocation [methodName=$invoke, parameterTypes=[class java.lang.String, class [Ljava.lang.String;, class [Ljava.lang.Object;], arguments=[sayHello, [Ljava.lang.String;@42f5a7d7, [Ljava.lang.Object;@4c3251f9], attachments={path=org.apache.dubbo.samples.context.api.ContextService, input=342, dubbo=2.0.2, interface=org.apache.dubbo.samples.context.api.ContextService, version=0.0.0, generic=true}]
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.getInvoker(DubboProtocol.java:223)
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:82)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:103)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:200)
at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

at org.apache.dubbo.rpc.protocol.dubbo.DubboInvoker.doInvoke(DubboInvoker.java:113)
at org.apache.dubbo.rpc.protocol.AbstractInvoker.invoke(AbstractInvoker.java:156)
at org.apache.dubbo.rpc.filter.GenericImplFilter.invoke(GenericImplFilter.java:172)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73)
at org.apache.dubbo.monitor.support.MonitorFilter.invoke(MonitorFilter.java:88)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73)
at org.apache.dubbo.rpc.protocol.dubbo.filter.FutureFilter.invoke(FutureFilter.java:49)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73)
at org.apache.dubbo.rpc.filter.ConsumerContextFilter.invoke(ConsumerContextFilter.java:54)
at org.apache.dubbo.rpc.protocol.ProtocolFilterWrapper$1.invoke(ProtocolFilterWrapper.java:73)
at org.apache.dubbo.rpc.listener.ListenerInvokerWrapper.invoke(ListenerInvokerWrapper.java:77)
at org.apache.dubbo.rpc.proxy.InvokerInvocationHandler.invoke(InvokerInvocationHandler.java:57)
at org.apache.dubbo.common.bytecode.proxy0.$invoke(proxy0.java)
at org.apache.dubbo.samples.generic.call.GenericCallConsumer.main(GenericCallConsumer.java:74)
Caused by: org.apache.dubbo.remoting.RemotingException: org.apache.dubbo.remoting.RemotingException: Not found exported service: org.apache.dubbo.samples.context.api.ContextService:20890 in [1.0.0/org.apache.dubbo.samples.context.api.ContextService:20890], may be version or group mismatch , channel: consumer: /x.x.x.x:43004 --> provider: /x.x.x.x:20890, message:RpcInvocation [methodName=$invoke, parameterTypes=[class java.lang.String, class [Ljava.lang.String;, class [Ljava.lang.Object;], arguments=[sayHello, [Ljava.lang.String;@42f5a7d7, [Ljava.lang.Object;@4c3251f9], attachments={path=org.apache.dubbo.samples.context.api.ContextService, input=342, dubbo=2.0.2, interface=org.apache.dubbo.samples.context.api.ContextService, version=0.0.0, generic=true}]
org.apache.dubbo.remoting.RemotingException: Not found exported service: org.apache.dubbo.samples.context.api.ContextService:20890 in [1.0.0/org.apache.dubbo.samples.context.api.ContextService:20890], may be version or group mismatch , channel: consumer: /x.x.x.x:43004 --> provider: /x.x.x.x:20890, message:RpcInvocation [methodName=$invoke, parameterTypes=[class java.lang.String, class [Ljava.lang.String;, class [Ljava.lang.Object;], arguments=[sayHello, [Ljava.lang.String;@42f5a7d7, [Ljava.lang.Object;@4c3251f9], attachments={path=org.apache.dubbo.samples.context.api.ContextService, input=342, dubbo=2.0.2, interface=org.apache.dubbo.samples.context.api.ContextService, version=0.0.0, generic=true}]
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol.getInvoker(DubboProtocol.java:223)
at org.apache.dubbo.rpc.protocol.dubbo.DubboProtocol$1.reply(DubboProtocol.java:82)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.handleRequest(HeaderExchangeHandler.java:103)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.received(HeaderExchangeHandler.java:200)
at org.apache.dubbo.remoting.transport.DecodeHandler.received(DecodeHandler.java:51)
at org.apache.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:57)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)

at org.apache.dubbo.remoting.exchange.support.DefaultFuture.returnFromResponse(DefaultFuture.java:298)
at org.apache.dubbo.remoting.exchange.support.DefaultFuture.get(DefaultFuture.java:191)
at org.apache.dubbo.remoting.exchange.support.DefaultFuture.get(DefaultFuture.java:164)
at org.apache.dubbo.rpc.protocol.dubbo.DubboInvoker.doInvoke(DubboInvoker.java:108)
... 13 more

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 sierra

Java version: 1.8

Steps to reproduce this issue

start provider with two service defined.

<bean id="demo1" class="com.ctrip.framework.cdubbo.DemoServiceImpl"/>
<dubbo:service interface="com.ctrip.framework.cdubbo.DemoService" ref="demo1">
</dubbo:service>

<bean id="demo2" class="com.ctrip.framework.cdubbo.DemoService2Impl"/>
<dubbo:service interface="com.ctrip.framework.cdubbo.DemoService2" ref="demo2">
</dubbo:service>

refer the two different service in lazy connection.

<dubbo:reference id="demoService1" interface="com.ctrip.framework.cdubbo.DemoService" lazy="true">
</dubbo:reference>

<dubbo:reference id="demoService2" interface="com.ctrip.framework.cdubbo.DemoService2" lazy="true">
</dubbo:reference>

3.when client started, the netstat -ano shows the connection status as following.

TCP 0.0.0.0:20880 0.0.0.0:0 LISTENING 388
TCP [::]:20880 [::]:0 LISTENING 388

send a call to DemoService, the connection from 10.xx.xx.151:50776-> 10.xx.xx.151:20880 is established.

TCP 0.0.0.0:20880 0.0.0.0:0 LISTENING 388
TCP 10.xx.xx.151:20880 10.xx.xx.151:50776 ESTABLISHED 388
TCP 10.xx.xx.151:50776 10.xx.xx.151:20880 ESTABLISHED 22444
TCP [::]:20880 [::]:0 LISTENING 388

send another call to DemoService2, a new connection is established (10.xx.xx.151:50778-> 10.xx.xx.151:20880)

TCP 0.0.0.0:20880 0.0.0.0:0 LISTENING 388
TCP 10.xx.xx.151:20880 10.xx.xx.151:50776 ESTABLISHED 388
TCP 10.xx.xx.151:20880 10.xx.xx.151:50778 ESTABLISHED 388
TCP 10.xx.xx.151:50776 10.xx.xx.151:20880 ESTABLISHED 22444
TCP 10.xx.xx.151:50778 10.xx.xx.151:20880 ESTABLISHED 22444
TCP [::]:20880 [::]:0 LISTENING 388

For request-response mode, create new connection is not a big deal.

But, for stream callback, response cannot come back once url changed(Dubbo will destroy the old invoker and connection, due to lazy cannot share connection in some circumstance).