-
Notifications
You must be signed in to change notification settings - Fork 26.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
服务端从2.5.8升级到2.7.3后,客户端使用老版本调用服务端,Version.getIntVersion报错,响应失败 #5396
Comments
客户端依赖的jar包文件名是dubbo-client.jar ,里面的pom文件版本写的是0.0.1-SNAPSHOT的时候。 |
客户端文件名是dubbo-client.jar ,解析到的版本号是client |
#4488 |
for versions before 2.7.3, it only considers versions with the following format as legal:
Notice that if you are using Dubbo before v2.6.2, the version value is the same as the jar version. |
好的,多谢 |
Environment
参考#3784,Version.parseInt未再判断字符串的合法性,也未做异常处理
该bug还未修复。version从文件名获取,当文件名是dubbo-client.jar,解析得到version = "client" 时,isSupportResponseAttachment(Version.java:102) 中的代码块
if (StringUtils.isEmpty(version)) {
return false;
}
就失效了。
后续Version.parseInt未再判断字符串的合法性,也未做异常处理。
也就是会报错如下:
11/28 15:03:45.504 WARN org.apache.dubbo.remoting.exchange.codec.ExchangeCodec [NettyServerWorker-6-7] [DUBBO] Fail to encode response: Response [id=0, version=client, status=20, event=false, error=null, result=AppResponse [value=cn.pengh.core.rpc.RpcResponse@49995603, exception=null]], send bad_response info instead, cause: For input string: "", dubbo version: 2.7.3, current host: 192.168.6.46
java.lang.NumberFormatException: For input string: ""
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65) ~[?:1.8.0_201]
at java.lang.Integer.parseInt(Integer.java:592) ~[?:1.8.0_201]
at java.lang.Integer.parseInt(Integer.java:615) ~[?:1.8.0_201]
at org.apache.dubbo.common.Version.parseInt(Version.java:133) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.common.Version.getIntVersion(Version.java:118) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.common.Version.isSupportResponseAttachment(Version.java:102) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.protocol.dubbo.DubboCodec.encodeResponseData(DubboCodec.java:195) ~[dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.encodeResponse(ExchangeCodec.java:283) [dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.remoting.exchange.codec.ExchangeCodec.encode(ExchangeCodec.java:71) [dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.rpc.protocol.dubbo.DubboCountCodec.encode(DubboCountCodec.java:40) [dubbo-2.7.3.jar:2.7.3]
at org.apache.dubbo.remoting.transport.netty4.NettyCodecAdapter$InternalEncoder.encode(NettyCodecAdapter.java:70) [dubbo-2.7.3.jar:2.7.3]
at io.netty.handler.codec.MessageToByteEncoder.write(MessageToByteEncoder.java:107) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:716) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:708) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:791) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:701) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.handler.timeout.IdleStateHandler.write(IdleStateHandler.java:303) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:716) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:708) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:791) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.write(AbstractChannelHandlerContext.java:701) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.ChannelDuplexHandler.write(ChannelDuplexHandler.java:115) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at org.apache.dubbo.remoting.transport.netty4.NettyServerHandler.write(NettyServerHandler.java:103) [dubbo-2.7.3.jar:2.7.3]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite0(AbstractChannelHandlerContext.java:716) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.invokeWrite(AbstractChannelHandlerContext.java:708) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext.access$1700(AbstractChannelHandlerContext.java:56) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.write(AbstractChannelHandlerContext.java:1102) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext$WriteAndFlushTask.write(AbstractChannelHandlerContext.java:1149) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.AbstractChannelHandlerContext$AbstractWriteTask.run(AbstractChannelHandlerContext.java:1073) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.AbstractEventExecutor.safeExecute(AbstractEventExecutor.java:163) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor.runAllTasks(SingleThreadEventExecutor.java:510) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.channel.nio.NioEventLoop.run(NioEventLoop.java:518) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.SingleThreadEventExecutor$6.run(SingleThreadEventExecutor.java:1050) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30) [netty-all-4.1.43.Final.jar:4.1.43.Final]
at java.lang.Thread.run(Thread.java:748) [?:1.8.0_201]
The text was updated successfully, but these errors were encountered: