amaliujia commented on a change in pull request #278:
URL: https://github.com/apache/incubator-ratis/pull/278#discussion_r523943833



##########
File path: 
ratis-netty/src/main/java/org/apache/ratis/netty/server/DataStreamManagement.java
##########
@@ -331,7 +333,24 @@ static void replyDataStreamException(RaftServer server, 
Throwable cause, RaftCli
       DataStreamRequestByteBuf request, ChannelHandlerContext ctx) {
     DataStreamException dataStreamException = new 
DataStreamException(server.getId(), cause);
     RaftClientReply reply = new RaftClientReply(raftClientRequest, 
dataStreamException, null);
-    ctx.writeAndFlush(newDataStreamReplyByteBuffer(request, reply));
+    sendDataStreamException(cause, request, reply, ctx);
+  }
+
+  void replyDataStreamException(Throwable cause, DataStreamRequestByteBuf 
request, ChannelHandlerContext ctx) {
+    DataStreamException dataStreamException = new 
DataStreamException(server.getId(), cause);
+    RaftClientReply reply = new RaftClientReply(ClientId.emptyClientId(), 
server.getId(), RaftGroupId.emptyGroupId(),
+        -1, false, null, dataStreamException, 0L, null);
+    sendDataStreamException(cause, request, reply, ctx);
+  }
+
+  static void sendDataStreamException(Throwable throwable, 
DataStreamRequestByteBuf request, RaftClientReply reply,
+      ChannelHandlerContext ctx) {
+    LOG.warn("Failed to process {}",  request, throwable);

Review comment:
       Got it! Thanks!




----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to