liangyepianzhou commented on code in PR #17051:
URL: https://github.com/apache/pulsar/pull/17051#discussion_r946574050
##########
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:
I just tested it. Elements can be deleted as expected in `for each`. And
because when the channel is Inactive, this ClientCnx will not be reused but
recycled by the JVM, so we don't really care whether it is really deleted.
Therefore, there will be no related side effects.
--
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]