eolivelli commented on code in PR #17051:
URL: https://github.com/apache/pulsar/pull/17051#discussion_r946515040
##########
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:
is it really allowed and officially supported to mutate the collection
inside a forEach loop ?
are there any 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]