Commit 911edd8d by huangfusuper

修复RPCserver调用失败后无法写回的BUG

parent 58410825
...@@ -89,7 +89,6 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin ...@@ -89,7 +89,6 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin
rpcResponsePacket.setRunTime(endTime-startTime); rpcResponsePacket.setRunTime(endTime-startTime);
rpcResponsePacket.setExtension(msg.getExtension()); rpcResponsePacket.setExtension(msg.getExtension());
rpcResponsePacket.setType(ResponseTyEnum.RESPONSE.getType()); rpcResponsePacket.setType(ResponseTyEnum.RESPONSE.getType());
ctx.channel().writeAndFlush(rpcResponsePacket);
}catch (Throwable e){ }catch (Throwable e){
rpcResponsePacket.setCode(JobResultEnum.FAIL.getCode()); rpcResponsePacket.setCode(JobResultEnum.FAIL.getCode());
rpcResponsePacket.setMsg(PluginLogUtils.getMessage(e)); rpcResponsePacket.setMsg(PluginLogUtils.getMessage(e));
...@@ -100,8 +99,10 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin ...@@ -100,8 +99,10 @@ public class NettyPluginServerHandler extends SimpleChannelInboundHandler<Plugin
execute.setCode(JobResultEnum.FAIL.getCode()); execute.setCode(JobResultEnum.FAIL.getCode());
rpcResponsePacket.setResult(execute); rpcResponsePacket.setResult(execute);
rpcResponsePacket.setType(ResponseTyEnum.RESPONSE.getType()); rpcResponsePacket.setType(ResponseTyEnum.RESPONSE.getType());
ctx.channel().writeAndFlush(rpcResponsePacket);
throw new RuntimeException(e); throw new RuntimeException(e);
}finally {
ctx.channel().writeAndFlush(rpcResponsePacket);
} }
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment