<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.1</li>
<li>Operating System version: mac 10.13.6</li>
<li>Java version: java8</li>
</ul>
<p dir="auto">I believe there are some problem in netty idleStateHandler, sometimes we need config readIdle timeout and writeIdle timeout when business logic needed. There is a enhancement about this.</p>
<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/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/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.5.9目前使用/2.7.2也检查了确实还是有此逻辑bug</li>
<li>Operating System version: suse</li>
<li>Java version: 1.8</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<p dir="auto">注册中心 zookeeper  。protocol ：dubbo</p>
<ol dir="auto">
<li>优雅停机逻辑为首先断开所有注册中心连接，然后断开所有protocol连接<br>
// destroy all the registries<br>
AbstractRegistryFactory.destroyAll();<br>
// destroy all the protocols<br>
destroyProtocols();</li>
<li>zk收到provider下线请求会通知consumer一个event，让其对invokersList进行操作，更新（删除）下线的provider。在此更新完成前，如果仍旧有请求持续进入，有可能选中此provider，从而导致交易失败</li>
<li>是否可以把Dubboprotocol.close中sendreadonlyEvnent提前到AbstractRegistryFactory.destroyAll();前，先把channel状态置为readonly，这样invoker.isavailable（）=false，就不会被选中了。</li>
</ol>
<p dir="auto">ps：还有个小问题，在只有一个提供者的情况下，为何不判断invoker.isavailable（）？在分批停机升级的时候，最后一台不论invoker.isavailable（）状态必然被选中，还是会有隐患。</p>