symious commented on code in PR #1179:
URL: https://github.com/apache/ratis/pull/1179#discussion_r1853185004
##########
ratis-netty/src/main/java/org/apache/ratis/netty/server/DataStreamManagement.java:
##########
@@ -390,8 +390,13 @@ static void sendDataStreamException(Throwable throwable,
DataStreamRequestByteBu
void cleanUp(Set<ClientInvocationId> ids) {
for (ClientInvocationId clientInvocationId : ids) {
Optional.ofNullable(streams.remove(clientInvocationId))
- .map(StreamInfo::getLocal)
- .ifPresent(LocalStream::cleanUp);
+ .ifPresent(streamInfo -> {
+ streamInfo.getDivision()
+ .getDataStreamMap()
+ .remove(clientInvocationId);
+ streamInfo.getLocal().cleanUp();
+ streamInfo.applyToRemotes(out -> out.out.closeAsync());
+ });
Review Comment:
@szetszwo Thanks for the review.
```
+ if (removed != info) {
+ info.cleanUp(key);
+ }
```
For the above code, I was wondering in what cases will "removed not equal to
info". I think in the original code, info was checked because in catch
exception in `read()` we don't know the info and we give an "null", but here
`info` should be equal to r`emoved`?
--
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]