You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "haiyang1985 (GitHub)" <gi...@apache.org> on 2019/12/24 07:13:44 UTC
[GitHub] [dubbo] haiyang1985 opened issue #5531: Lazy connection is
not shared sometimes.
- [ ] I have searched the [issues](https://github.com/apache/dubbo/issues) of this repository and believe that this is not a duplicate.
- [ ] I have checked the [FAQ](https://github.com/apache/dubbo/blob/master/FAQ.md) 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
1. 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>
```
2. 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
```
4. 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
```
5. 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).
[ Full content available at: https://github.com/apache/dubbo/issues/5531 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org