<ul class="contains-task-list">
<li class="task-list-item"><input type="checkbox" id="" disabled="" class="task-list-item-checkbox"> 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"> 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.3</li>
<li>Operating System version: Red Hat Enterprise Linux Server release 6.5</li>
<li>Java version: jdk1.8.0_201</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>使用kryo序列化，消费者与提供者参数结构修改成不一致时进行服务调用。</li>
</ol>
<p dir="auto">Pls. provide [GitHub address] to reproduce this issue.</p>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">希望应用层有捕获解码异常的方法，并进行相关的告警。</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">What actually happens?<br>
没有找到良好的办法捕获解码异常。对序列化进行扩展可以勉强实现。</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="WARN :20191011.162324579:NettyServerWorker-4-8: [DUBBO] Decode argument failed: com.esotericsoftware.kryo.KryoException: Unable to find class: NY
Serialization trace:
exrate (com.xx.yy.dto.XXXNotityMsg)
body (com.xx.yy.dto.ZZTopMsg), dubbo version: 2.7.3, current host: 172.16.10.27:DecodeableRpcInvocation.java:119
java.io.IOException: com.esotericsoftware.kryo.KryoException: Unable to find class: NY
Serialization trace:
exrate (com.xx.yy.dto.XXXNotityMsg)
body (com.xx.yy.dto.ZZTopMsg)
        at org.apache.dubbo.common.serialize.kryo.KryoObjectInput.readObject(KryoObjectInput.java:138) ~[dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.common.serialize.kryo.KryoObjectInput.readObject(KryoObjectInput.java:147) ~[dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcInvocation.decode(DecodeableRpcInvocation.java:116) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcInvocation.decode(DecodeableRpcInvocation.java:73) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:132) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:122) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:82) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.rpc.protocol.dubbo.DubboCountCodec.decode(DubboCountCodec.java:48) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.remoting.transport.netty4.NettyCodecAdapter$InternalDecoder.decode(NettyCodecAdapter.java:90) [dubbo-2.7.3.jar:2.7.3]
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:628) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:563) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
Caused by: com.esotericsoftware.kryo.KryoException: Unable to find class: NY
Serialization trace:
exrate (com.xx.yy.dto.XXXNotityMsg)
body (com.xx.yy.dto.ZZTopMsg)
        at com.esotericsoftware.kryo.util.DefaultClassResolver.readName(DefaultClassResolver.java:160) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:133) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:693) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:118) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
        at org.apache.dubbo.common.serialize.kryo.KryoObjectInput.readObject(KryoObjectInput.java:136) ~[dubbo-2.7.3.jar:2.7.3]
        ... 26 more
Caused by: java.lang.ClassNotFoundException: NY
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_201]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_201]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[?:1.8.0_201]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_201]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_201]
        at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_201]
        at com.esotericsoftware.kryo.util.DefaultClassResolver.readName(DefaultClassResolver.java:154) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:133) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:693) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:118) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
        at org.apache.dubbo.common.serialize.kryo.KryoObjectInput.readObject(KryoObjectInput.java:136) ~[dubbo-2.7.3.jar:2.7.3]"><pre class="notranslate"><code class="notranslate">WARN :20191011.162324579:NettyServerWorker-4-8: [DUBBO] Decode argument failed: com.esotericsoftware.kryo.KryoException: Unable to find class: NY
Serialization trace:
exrate (com.xx.yy.dto.XXXNotityMsg)
body (com.xx.yy.dto.ZZTopMsg), dubbo version: 2.7.3, current host: 172.16.10.27:DecodeableRpcInvocation.java:119
java.io.IOException: com.esotericsoftware.kryo.KryoException: Unable to find class: NY
Serialization trace:
exrate (com.xx.yy.dto.XXXNotityMsg)
body (com.xx.yy.dto.ZZTopMsg)
        at org.apache.dubbo.common.serialize.kryo.KryoObjectInput.readObject(KryoObjectInput.java:138) ~[dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.common.serialize.kryo.KryoObjectInput.readObject(KryoObjectInput.java:147) ~[dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcInvocation.decode(DecodeableRpcInvocation.java:116) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.rpc.protocol.dubbo.DecodeableRpcInvocation.decode(DecodeableRpcInvocation.java:73) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.rpc.protocol.dubbo.DubboCodec.decodeBody(DubboCodec.java:132) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:122) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.decode(ExchangeCodec.java:82) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.rpc.protocol.dubbo.DubboCountCodec.decode(DubboCountCodec.java:48) [dubbo-2.7.3.jar:2.7.3]
        at org.apache.dubbo.remoting.transport.netty4.NettyCodecAdapter$InternalDecoder.decode(NettyCodecAdapter.java:90) [dubbo-2.7.3.jar:2.7.3]
        at io.netty.handler.codec.ByteToMessageDecoder.decodeRemovalReentryProtection(ByteToMessageDecoder.java:489) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.callDecode(ByteToMessageDecoder.java:428) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:265) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:340) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1434) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:362) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:348) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:965) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:163) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKey(NioEventLoop.java:628) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeysOptimized(NioEventLoop.java:563) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.nio.NioEventLoop.processSelectedKeys(NioEventLoop.java:480) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:442) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:884) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.29.Final.jar:4.1.29.Final]
        at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
Caused by: com.esotericsoftware.kryo.KryoException: Unable to find class: NY
Serialization trace:
exrate (com.xx.yy.dto.XXXNotityMsg)
body (com.xx.yy.dto.ZZTopMsg)
        at com.esotericsoftware.kryo.util.DefaultClassResolver.readName(DefaultClassResolver.java:160) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:133) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:693) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:118) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
        at org.apache.dubbo.common.serialize.kryo.KryoObjectInput.readObject(KryoObjectInput.java:136) ~[dubbo-2.7.3.jar:2.7.3]
        ... 26 more
Caused by: java.lang.ClassNotFoundException: NY
        at java.net.URLClassLoader.findClass(URLClassLoader.java:382) ~[?:1.8.0_201]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:424) ~[?:1.8.0_201]
        at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:349) ~[?:1.8.0_201]
        at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ~[?:1.8.0_201]
        at java.lang.Class.forName0(Native Method) ~[?:1.8.0_201]
        at java.lang.Class.forName(Class.java:348) ~[?:1.8.0_201]
        at com.esotericsoftware.kryo.util.DefaultClassResolver.readName(DefaultClassResolver.java:154) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.util.DefaultClassResolver.readClass(DefaultClassResolver.java:133) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readClass(Kryo.java:693) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:118) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readObject(Kryo.java:731) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.ObjectField.read(ObjectField.java:125) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.serializers.FieldSerializer.read(FieldSerializer.java:540) ~[kryo-4.0.0.jar:?]
        at com.esotericsoftware.kryo.Kryo.readClassAndObject(Kryo.java:813) ~[kryo-4.0.0.jar:?]
        at org.apache.dubbo.common.serialize.kryo.KryoObjectInput.readObject(KryoObjectInput.java:136) ~[dubbo-2.7.3.jar:2.7.3]
</code></pre></div>
<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.6.1</li>
<li>Operating System version: centOS7</li>
<li>Java version: 1.7</li>
</ul>
<h3 dir="auto">Steps to reproduce this issue</h3>
<ol dir="auto">
<li>停机服务，重启</li>
<li>dubbo无法注册到zk，已检查端口和ip无异常</li>
<li>DubboServerHandler一直启线程，直到OOM</li>
</ol>
<h3 dir="auto">Expected Result</h3>
<p dir="auto">期望服务重启后，可以正常注册到zk，平稳提供服务</p>
<h3 dir="auto">Actual Result</h3>
<p dir="auto">OOM，服务崩溃</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="Exception in thread &quot;DubboServerHandler-10.20.200.108:21030-thread-52&quot; java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.util.concurrent.ConcurrentHashMap$Segment.put(ConcurrentHashMap.java:457)
        at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1130)
        at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.setAttribute(NettyChannel.java:153)
        at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.disconnected(HeaderExchangeHandler.java:118)
        at com.alibaba.dubbo.remoting.transport.AbstractChannelHandlerDelegate.disconnected(AbstractChannelHandlerDelegate.java:45)
        at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:64)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)
"><pre class="notranslate"><code class="notranslate">Exception in thread "DubboServerHandler-10.20.200.108:21030-thread-52" java.lang.OutOfMemoryError: GC overhead limit exceeded
        at java.util.concurrent.ConcurrentHashMap$Segment.put(ConcurrentHashMap.java:457)
        at java.util.concurrent.ConcurrentHashMap.put(ConcurrentHashMap.java:1130)
        at com.alibaba.dubbo.remoting.transport.netty.NettyChannel.setAttribute(NettyChannel.java:153)
        at com.alibaba.dubbo.remoting.exchange.support.header.HeaderExchangeHandler.disconnected(HeaderExchangeHandler.java:118)
        at com.alibaba.dubbo.remoting.transport.AbstractChannelHandlerDelegate.disconnected(AbstractChannelHandlerDelegate.java:45)
        at com.alibaba.dubbo.remoting.transport.dispatcher.ChannelEventRunnable.run(ChannelEventRunnable.java:64)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
        at java.lang.Thread.run(Thread.java:745)

</code></pre></div>