amaliujia commented on a change in pull request #236:
URL: https://github.com/apache/incubator-ratis/pull/236#discussion_r513742069
##########
File path:
ratis-netty/src/main/java/org/apache/ratis/netty/server/NettyServerStreamRpc.java
##########
@@ -170,12 +190,12 @@ public void addRaftPeers(Collection<RaftPeer> newPeers) {
proxies.addPeers(newPeers);
}
- private CompletableFuture<DataStream> getDataStreamFuture(ByteBuf buf) {
+ private StreamInfo newStreamInfo(ByteBuf buf) {
try {
- final RaftClientRequest request =
-
ClientProtoUtils.toRaftClientRequest(RaftProtos.RaftClientRequestProto.parseFrom(buf.nioBuffer()));
- return stateMachine.data().stream(request);
- } catch (InvalidProtocolBufferException e) {
+ final RaftClientRequest request = ClientProtoUtils.toRaftClientRequest(
+ RaftClientRequestProto.parseFrom(buf.nioBuffer()));
+ return new StreamInfo(stateMachine.data().stream(request),
proxies.getDataStreamOutput());
+ } catch (Throwable e) {
Review comment:
Out of curiosity: why not use `Exception e`?
----------------------------------------------------------------
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]