You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@ratis.apache.org by GitBox <gi...@apache.org> on 2022/02/22 16:56:56 UTC
[GitHub] [ratis] szetszwo commented on a change in pull request #606: RATIS-1529. Handle when there is an exception in NettyServerStreamRpc# getDataStreamOutput
szetszwo commented on a change in pull request #606:
URL: https://github.com/apache/ratis/pull/606#discussion_r812159236
##########
File path: ratis-netty/src/main/java/org/apache/ratis/netty/server/NettyServerStreamRpc.java
##########
@@ -97,9 +97,17 @@ private void getDataStreamOutput(RaftClientRequest request, Set<RaftPeer> peers,
throws IOException {
for (RaftPeer peer : peers) {
try {
- outs.add((DataStreamOutputRpc) map.getProxy(peer.getId()).stream(request));
+ DataStreamClient client = map.getProxy(peer.getId());
+ outs.add((DataStreamOutputRpc) client.stream(request));
} catch (IOException e) {
- throw new IOException(map.getName() + ": Failed to getDataStreamOutput for " + peer, e);
+ map.handleException(peer.getId(), e, false);
+ throw new IOException(
+ map.getName() + ": Failed to getDataStreamOutput for " + peer, e);
+ } catch (NullPointerException e) {
Review comment:
@guohao-rosicky , this is not about the title of the JIRA. Please see how could we fix the NPE. We really should not catch Exception in NettyServerStreamRpc. It hides a bug instead of fixing it.
--
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.
To unsubscribe, e-mail: issues-unsubscribe@ratis.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org