michaeljmarshall commented on a change in pull request #13428:
URL: https://github.com/apache/pulsar/pull/13428#discussion_r773335145



##########
File path: 
pulsar-broker/src/main/java/org/apache/pulsar/broker/service/ServerCnx.java
##########
@@ -292,24 +292,30 @@ public void channelInactive(ChannelHandlerContext ctx) 
throws Exception {
 
         // Connection is gone, close the producers immediately
         producers.forEach((__, producerFuture) -> {
+            // prevent race conditions in completing producers
+            if (!producerFuture.isDone()
+                    && producerFuture.completeExceptionally(new 
IllegalStateException("Connection closed."))) {

Review comment:
       @lhotari - maybe you were trying to avoid initializing the 
`IllegalStateException`? Maybe my proposed change isn't better. Let me know 
what you think.




-- 
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]


Reply via email to