symious commented on code in PR #1179:
URL: https://github.com/apache/ratis/pull/1179#discussion_r1855299581
##########
ratis-netty/src/main/java/org/apache/ratis/netty/server/DataStreamManagement.java:
##########
@@ -459,7 +461,12 @@ private void readImpl(DataStreamRequestByteBuf request,
ChannelHandlerContext ct
localWrite = CompletableFuture.completedFuture(0L);
remoteWrites = Collections.emptyList();
} else if (request.getType() == Type.STREAM_DATA) {
- localWrite = info.getLocal().write(request.slice(),
request.getWriteOptionList(), writeExecutor);
+ if (close && request.getDataLength() == 0) {
Review Comment:
```
+ if (request.getType() == Type.STREAM_HEADER
+ || (close && request.getDataLength() == 0)) {
localWrite = CompletableFuture.completedFuture(0L);
remoteWrites = Collections.emptyList();
```
If it's changed here, the current server won't do the clean up, and the
successor will not get clean up too.
I think the overall view looks like:
1. Server1 decides to removeStream, it will call local cleanUp, and it will
send an empty close request to succssor.
2. Server2 receives the empty request, do the local cleanUp, and send the
empty close request to successor.
3. Server3 receives the empty request, do the local cleanUp, since no
successor here, clean up end here.
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]