UnicastZenPing's PingingRound should prevent opening connections after being closed
This may cause them to leak. Provisioning for it was made in #22277 but sadly a crucial ensureOpen call was forgotten
This commit is contained in:
parent
7d0dbd2082
commit
13c5881f3e
|
@ -385,12 +385,14 @@ public class UnicastZenPing extends AbstractComponent implements ZenPing {
|
|||
try (Releasable ignore = connectionLock.acquire(node.getAddress())) {
|
||||
result = tempConnections.get(node.getAddress());
|
||||
if (result == null) {
|
||||
ensureOpen();
|
||||
boolean success = false;
|
||||
result = transportService.openConnection(node, connectionProfile);
|
||||
try {
|
||||
transportService.handshake(result, connectionProfile.getHandshakeTimeout().millis());
|
||||
synchronized (this) {
|
||||
// acquire lock to prevent concurrent closing
|
||||
// acquire lock and check if closed, to prevent leaving an open connection after closing
|
||||
ensureOpen();
|
||||
Connection existing = tempConnections.put(node.getAddress(), result);
|
||||
assert existing == null;
|
||||
success = true;
|
||||
|
|
Loading…
Reference in New Issue