<ul dir="auto">
<li>[√] I have searched the <a href="https://github.com/apache/dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li>[√] I have checked the <a href="https://github.com/apache/dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.4.1</li>
<li>Operating System version: docker alpine in k8s</li>
<li>Java version: 1.8</li>
<li>register: nacos 1.1.3</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>Start module A and module B， A depends on B, the register is nacos. Now A invoke B's dubbo interface correct.</li>
<li>Restart module B, because in k8s and module B’s IP address is changed.</li>
<li>Now A invoke B correct, but A begin reconnect to the old provider B and can not stop. The logs as below:</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">What do you expected from the above steps？</h3>
<p dir="auto">stop reconnect to the old provider</p>
<h3 dir="auto">What actually happens?</h3>
<p dir="auto">Actual Result is cannot stop reconnect to the old provider</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="[ERROR] 2020-03-31 22:16:19.303 [] [] [dubbo-client-idleCheck-thread-1] ReconnectTimerTask.doTask[51]: [DUBBO] Fail to connect to HeaderExchangeClient [channel=org.apache.dubbo.remoting.transport.netty4.NettyClient [10.42.1.119:0 -&gt; /10.42.1.115:20881]], dubbo version: 2.7.4.1, current host: 10.42.1.119
org.apache.dubbo.remoting.RemotingException: client(url: dubbo://10.42.1.115:20881/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&amp;application=mall-open&amp;bind.ip=10.42.1.115&amp;bind.port=20881&amp;check=false&amp;codec=dubbo&amp;deprecated=false&amp;dubbo=2.0.2&amp;dynamic=true&amp;generic=true&amp;group=mall-goods&amp;heartbeat=60000&amp;interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&amp;lazy=false&amp;methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&amp;pid=6&amp;qos.enable=false&amp;register.ip=10.42.1.119&amp;release=2.7.4.1&amp;remote.application=mall-goods&amp;revision=2.2.0.RELEASE&amp;side=consumer&amp;sticky=false&amp;timeout=30000&amp;timestamp=1585642448627&amp;version=1.0.0) failed to connect to server /10.42.1.115:20881 client-side timeout 3000ms (elapsed: 3000ms) from netty client 10.42.1.119 using dubbo version 2.7.4.1
at org.apache.dubbo.remoting.transport.netty4.NettyClient.doConnect(NettyClient.java:166)
at org.apache.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:190)
at org.apache.dubbo.remoting.transport.AbstractClient.reconnect(AbstractClient.java:246)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeClient.reconnect(HeaderExchangeClient.java:155)
at org.apache.dubbo.remoting.exchange.support.header.ReconnectTimerTask.doTask(ReconnectTimerTask.java:49)
at org.apache.dubbo.remoting.exchange.support.header.AbstractTimerTask.run(AbstractTimerTask.java:87)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:648)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:727)
at org.apache.dubbo.common.timer.HashedWheelTimer$Worker.run(HashedWheelTimer.java:449)
at java.lang.Thread.run(Thread.java:748)
[ERROR] 2020-03-31 22:17:23.303 [] [] [dubbo-client-idleCheck-thread-1] ReconnectTimerTask.doTask[51]: [DUBBO] Fail to connect to HeaderExchangeClient [channel=org.apache.dubbo.remoting.transport.netty4.NettyClient [10.42.1.119:0 -&gt; /10.42.1.115:20881]], dubbo version: 2.7.4.1, current host: 10.42.1.119
org.apache.dubbo.remoting.RemotingException: client(url: dubbo://10.42.1.115:20881/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&amp;application=mall-open&amp;bind.ip=10.42.1.115&amp;bind.port=20881&amp;check=false&amp;codec=dubbo&amp;deprecated=false&amp;dubbo=2.0.2&amp;dynamic=true&amp;generic=true&amp;group=mall-goods&amp;heartbeat=60000&amp;interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&amp;lazy=false&amp;methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&amp;pid=6&amp;qos.enable=false&amp;register.ip=10.42.1.119&amp;release=2.7.4.1&amp;remote.application=mall-goods&amp;revision=2.2.0.RELEASE&amp;side=consumer&amp;sticky=false&amp;timeout=30000&amp;timestamp=1585642448627&amp;version=1.0.0) failed to connect to server /10.42.1.115:20881 client-side timeout 3000ms (elapsed: 3000ms) from netty client 10.42.1.119 using dubbo version 2.7.4.1
at org.apache.dubbo.remoting.transport.netty4.NettyClient.doConnect(NettyClient.java:166)
at org.apache.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:190)
at org.apache.dubbo.remoting.transport.AbstractClient.reconnect(AbstractClient.java:246)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeClient.reconnect(HeaderExchangeClient.java:155)
at org.apache.dubbo.remoting.exchange.support.header.ReconnectTimerTask.doTask(ReconnectTimerTask.java:49)
at org.apache.dubbo.remoting.exchange.support.header.AbstractTimerTask.run(AbstractTimerTask.java:87)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:648)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:727)
at org.apache.dubbo.common.timer.HashedWheelTimer$Worker.run(HashedWheelTimer.java:449)
at java.lang.Thread.run(Thread.java:748)
[ERROR] 2020-03-31 22:18:27.303 [] [] [dubbo-client-idleCheck-thread-1] ReconnectTimerTask.doTask[51]: [DUBBO] Fail to connect to HeaderExchangeClient [channel=org.apache.dubbo.remoting.transport.netty4.NettyClient [10.42.1.119:0 -&gt; /10.42.1.115:20881]], dubbo version: 2.7.4.1, current host: 10.42.1.119
org.apache.dubbo.remoting.RemotingException: client(url: dubbo://10.42.1.115:20881/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&amp;application=mall-open&amp;bind.ip=10.42.1.115&amp;bind.port=20881&amp;check=false&amp;codec=dubbo&amp;deprecated=false&amp;dubbo=2.0.2&amp;dynamic=true&amp;generic=true&amp;group=mall-goods&amp;heartbeat=60000&amp;interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&amp;lazy=false&amp;methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&amp;pid=6&amp;qos.enable=false&amp;register.ip=10.42.1.119&amp;release=2.7.4.1&amp;remote.application=mall-goods&amp;revision=2.2.0.RELEASE&amp;side=consumer&amp;sticky=false&amp;timeout=30000&amp;timestamp=1585642448627&amp;version=1.0.0) failed to connect to server /10.42.1.115:20881 client-side timeout 3000ms (elapsed: 3000ms) from netty client 10.42.1.119 using dubbo version 2.7.4.1
at org.apache.dubbo.remoting.transport.netty4.NettyClient.doConnect(NettyClient.java:166)
at org.apache.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:190)
at org.apache.dubbo.remoting.transport.AbstractClient.reconnect(AbstractClient.java:246)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeClient.reconnect(HeaderExchangeClient.java:155)
at org.apache.dubbo.remoting.exchange.support.header.ReconnectTimerTask.doTask(ReconnectTimerTask.java:49)
at org.apache.dubbo.remoting.exchange.support.header.AbstractTimerTask.run(AbstractTimerTask.java:87)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:648)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:727)
at org.apache.dubbo.common.timer.HashedWheelTimer$Worker.run(HashedWheelTimer.java:449)
at java.lang.Thread.run(Thread.java:748)"><pre class="notranslate"><code class="notranslate">[ERROR] 2020-03-31 22:16:19.303 [] [] [dubbo-client-idleCheck-thread-1] ReconnectTimerTask.doTask[51]: [DUBBO] Fail to connect to HeaderExchangeClient [channel=org.apache.dubbo.remoting.transport.netty4.NettyClient [10.42.1.119:0 -&gt; /10.42.1.115:20881]], dubbo version: 2.7.4.1, current host: 10.42.1.119
org.apache.dubbo.remoting.RemotingException: client(url: dubbo://10.42.1.115:20881/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&amp;application=mall-open&amp;bind.ip=10.42.1.115&amp;bind.port=20881&amp;check=false&amp;codec=dubbo&amp;deprecated=false&amp;dubbo=2.0.2&amp;dynamic=true&amp;generic=true&amp;group=mall-goods&amp;heartbeat=60000&amp;interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&amp;lazy=false&amp;methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&amp;pid=6&amp;qos.enable=false&amp;register.ip=10.42.1.119&amp;release=2.7.4.1&amp;remote.application=mall-goods&amp;revision=2.2.0.RELEASE&amp;side=consumer&amp;sticky=false&amp;timeout=30000&amp;timestamp=1585642448627&amp;version=1.0.0) failed to connect to server /10.42.1.115:20881 client-side timeout 3000ms (elapsed: 3000ms) from netty client 10.42.1.119 using dubbo version 2.7.4.1
at org.apache.dubbo.remoting.transport.netty4.NettyClient.doConnect(NettyClient.java:166)
at org.apache.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:190)
at org.apache.dubbo.remoting.transport.AbstractClient.reconnect(AbstractClient.java:246)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeClient.reconnect(HeaderExchangeClient.java:155)
at org.apache.dubbo.remoting.exchange.support.header.ReconnectTimerTask.doTask(ReconnectTimerTask.java:49)
at org.apache.dubbo.remoting.exchange.support.header.AbstractTimerTask.run(AbstractTimerTask.java:87)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:648)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:727)
at org.apache.dubbo.common.timer.HashedWheelTimer$Worker.run(HashedWheelTimer.java:449)
at java.lang.Thread.run(Thread.java:748)
[ERROR] 2020-03-31 22:17:23.303 [] [] [dubbo-client-idleCheck-thread-1] ReconnectTimerTask.doTask[51]: [DUBBO] Fail to connect to HeaderExchangeClient [channel=org.apache.dubbo.remoting.transport.netty4.NettyClient [10.42.1.119:0 -&gt; /10.42.1.115:20881]], dubbo version: 2.7.4.1, current host: 10.42.1.119
org.apache.dubbo.remoting.RemotingException: client(url: dubbo://10.42.1.115:20881/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&amp;application=mall-open&amp;bind.ip=10.42.1.115&amp;bind.port=20881&amp;check=false&amp;codec=dubbo&amp;deprecated=false&amp;dubbo=2.0.2&amp;dynamic=true&amp;generic=true&amp;group=mall-goods&amp;heartbeat=60000&amp;interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&amp;lazy=false&amp;methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&amp;pid=6&amp;qos.enable=false&amp;register.ip=10.42.1.119&amp;release=2.7.4.1&amp;remote.application=mall-goods&amp;revision=2.2.0.RELEASE&amp;side=consumer&amp;sticky=false&amp;timeout=30000&amp;timestamp=1585642448627&amp;version=1.0.0) failed to connect to server /10.42.1.115:20881 client-side timeout 3000ms (elapsed: 3000ms) from netty client 10.42.1.119 using dubbo version 2.7.4.1
at org.apache.dubbo.remoting.transport.netty4.NettyClient.doConnect(NettyClient.java:166)
at org.apache.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:190)
at org.apache.dubbo.remoting.transport.AbstractClient.reconnect(AbstractClient.java:246)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeClient.reconnect(HeaderExchangeClient.java:155)
at org.apache.dubbo.remoting.exchange.support.header.ReconnectTimerTask.doTask(ReconnectTimerTask.java:49)
at org.apache.dubbo.remoting.exchange.support.header.AbstractTimerTask.run(AbstractTimerTask.java:87)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:648)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:727)
at org.apache.dubbo.common.timer.HashedWheelTimer$Worker.run(HashedWheelTimer.java:449)
at java.lang.Thread.run(Thread.java:748)
[ERROR] 2020-03-31 22:18:27.303 [] [] [dubbo-client-idleCheck-thread-1] ReconnectTimerTask.doTask[51]: [DUBBO] Fail to connect to HeaderExchangeClient [channel=org.apache.dubbo.remoting.transport.netty4.NettyClient [10.42.1.119:0 -&gt; /10.42.1.115:20881]], dubbo version: 2.7.4.1, current host: 10.42.1.119
org.apache.dubbo.remoting.RemotingException: client(url: dubbo://10.42.1.115:20881/com.alibaba.cloud.dubbo.service.DubboMetadataService?anyhost=true&amp;application=mall-open&amp;bind.ip=10.42.1.115&amp;bind.port=20881&amp;check=false&amp;codec=dubbo&amp;deprecated=false&amp;dubbo=2.0.2&amp;dynamic=true&amp;generic=true&amp;group=mall-goods&amp;heartbeat=60000&amp;interface=com.alibaba.cloud.dubbo.service.DubboMetadataService&amp;lazy=false&amp;methods=getAllServiceKeys,getServiceRestMetadata,getExportedURLs,getAllExportedURLs&amp;pid=6&amp;qos.enable=false&amp;register.ip=10.42.1.119&amp;release=2.7.4.1&amp;remote.application=mall-goods&amp;revision=2.2.0.RELEASE&amp;side=consumer&amp;sticky=false&amp;timeout=30000&amp;timestamp=1585642448627&amp;version=1.0.0) failed to connect to server /10.42.1.115:20881 client-side timeout 3000ms (elapsed: 3000ms) from netty client 10.42.1.119 using dubbo version 2.7.4.1
at org.apache.dubbo.remoting.transport.netty4.NettyClient.doConnect(NettyClient.java:166)
at org.apache.dubbo.remoting.transport.AbstractClient.connect(AbstractClient.java:190)
at org.apache.dubbo.remoting.transport.AbstractClient.reconnect(AbstractClient.java:246)
at org.apache.dubbo.remoting.exchange.support.header.HeaderExchangeClient.reconnect(HeaderExchangeClient.java:155)
at org.apache.dubbo.remoting.exchange.support.header.ReconnectTimerTask.doTask(ReconnectTimerTask.java:49)
at org.apache.dubbo.remoting.exchange.support.header.AbstractTimerTask.run(AbstractTimerTask.java:87)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelTimeout.expire(HashedWheelTimer.java:648)
at org.apache.dubbo.common.timer.HashedWheelTimer$HashedWheelBucket.expireTimeouts(HashedWheelTimer.java:727)
at org.apache.dubbo.common.timer.HashedWheelTimer$Worker.run(HashedWheelTimer.java:449)
at java.lang.Thread.run(Thread.java:748)
</code></pre></div>
<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have searched the <a href="https://github.com/apache/incubator-dubbo/issues">issues</a> of this repository and believe that this is not a duplicate.</li>
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox" checked=""> I have checked the <a href="https://github.com/apache/incubator-dubbo/blob/master/FAQ.md">FAQ</a> of this repository and believe that this is not a duplicate.</li>
</ul>
<h3 dir="auto">Environment</h3>
<ul dir="auto">
<li>Dubbo version: 2.7.0</li>
<li>Operating System version: any</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">Our company's registry is able to support request route (same as TagRouter), but we are able to combine one invoker to two different route rule.<br>
eg:<br>
TagRoute1:<br>
-&gt; Group1 (weight: 1)<br>
-&gt; Invoker1<br>
-&gt; Gropu2 (weight: 9)<br>
-&gt; Invoker2<br>
TagRoute2:<br>
-&gt; Group1 (weight: 5)<br>
-&gt; Invoker1<br>
-&gt; Gropu2 (weight: 5)<br>
-&gt; Invoker2</p>
<p dir="auto">In the consumer side, the call to Invoker1 and Invoker2 will have 1:9 weight in TagRoute1. The 5:5 weight for them in TagRoute2.<br>
The issue is that the dubbo get weight from invoker url, not in route level.</p>
<p dir="auto">I have some ideas for that which one do you prefer? If solutions have been fixed, then i can send a PR to fix it.</p>
<ol dir="auto">
<li>Add setUrl method for Invoker, then we are able to set weight in invoker URL.</li>
<li>Extend the invoker with weight property, then we are able to set weight for each invoker in the Router level.</li>
<li>Extend the AbstractLoadBalance, we are able to extend the getWeight.</li>
</ol>
<p dir="auto">When</p>
<ol dir="auto">
<li>xxx</li>
<li>xxx</li>
<li>xxx</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">What do you expected from the above steps？</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?</p>
<p dir="auto">If there is an exception, please attach the exception trace:</p>
<div class="snippet-clipboard-content notranslate position-relative overflow-auto" data-snippet-clipboard-copy-content="Just put your stack trace here!"><pre class="notranslate"><code class="notranslate">Just put your stack trace here!
</code></pre></div>