You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by GitBox <gi...@apache.org> on 2022/08/16 09:50:29 UTC

[GitHub] [pulsar] liangyepianzhou commented on a diff in pull request #17051: [Fix][Client] Fixed cnx channel Inactive causing the request fail to time out and fail to return

liangyepianzhou commented on code in PR #17051:
URL: https://github.com/apache/pulsar/pull/17051#discussion_r946563753


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/ClientCnx.java:
##########
@@ -290,7 +290,11 @@ public void channelInactive(ChannelHandlerContext ctx) throws Exception {
                 "Disconnected from server at " + ctx.channel().remoteAddress());
 
         // Fail out all the pending ops
-        pendingRequests.forEach((key, future) -> future.completeExceptionally(e));
+        pendingRequests.forEach((key, future) -> {
+            if (pendingRequests.remove(key, future) && !future.isDone()) {

Review Comment:
   Great suggestion, I'll check if it works.



-- 
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: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org