Skip to content

Commit

Permalink
FD_SOCK2 blocks on close(): https://issues.redhat.com/browse/JGRP-2766
Browse files Browse the repository at this point in the history
  • Loading branch information
belaban committed Feb 20, 2024
1 parent aa9aabd commit 4786ce5
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/org/jgroups/protocols/FD_SOCK2.java
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
import java.io.IOException;
import java.net.InetAddress;
import java.util.*;
import java.util.concurrent.CompletableFuture;
import java.util.concurrent.Future;
import java.util.function.Supplier;
import java.util.stream.Collectors;
Expand Down Expand Up @@ -290,7 +291,9 @@ public void connectionClosed(Connection conn) {
if(dest != null) {
log.debug("%s: connection to %s closed", local_addr, dest);
pingable_mbrs.remove(dest);
req_handler.add(new Request(Request.Type.ConnectToNextPingDest, dest));
// The reconnect might run on the NioConnection::acceptor's read() and thus block the CONNECT-RSP, and
// therefore has to be run in a separate thread: https://issues.redhat.com/browse/JGRP-2766
CompletableFuture.runAsync(() -> req_handler.add(new Request(Request.Type.ConnectToNextPingDest, dest)));
}
}
}
Expand Down

0 comments on commit 4786ce5

Please sign in to comment.