Revert "Discovery: a more lenient wait joinThread when stopping"
This reverts commit 83d9dab798
.
This commit is contained in:
parent
83d9dab798
commit
9ebce349e1
|
@ -253,7 +253,6 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen
|
|||
|
||||
@Override
|
||||
protected void doStop() throws ElasticsearchException {
|
||||
joinThreadControl.stop();
|
||||
pingService.stop();
|
||||
masterFD.stop("zen disco stop");
|
||||
nodesFD.stop();
|
||||
|
@ -283,6 +282,7 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen
|
|||
}
|
||||
}
|
||||
}
|
||||
joinThreadControl.stop();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -1354,14 +1354,15 @@ public class ZenDiscovery extends AbstractLifecycleComponent<Discovery> implemen
|
|||
running.set(false);
|
||||
Thread joinThread = currentJoinThread.getAndSet(null);
|
||||
if (joinThread != null) {
|
||||
for (int i = 0; i < 10 && joinThread.isAlive(); i++) {
|
||||
try {
|
||||
joinThread.interrupt();
|
||||
try {
|
||||
joinThread.join(200);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
return;
|
||||
}
|
||||
} catch (Exception e) {
|
||||
// ignore
|
||||
}
|
||||
try {
|
||||
joinThread.join(10000);
|
||||
} catch (InterruptedException e) {
|
||||
Thread.currentThread().interrupt();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -373,9 +373,6 @@ public class UnicastZenPing extends AbstractLifecycleComponent<ZenPing> implemen
|
|||
} catch (ConnectTransportException e) {
|
||||
// can't connect to the node - this is a more common path!
|
||||
logger.trace("[{}] failed to connect to {}", e, sendPingsHandler.id(), finalNodeToSend);
|
||||
} catch (RemoteTransportException e) {
|
||||
// something went wrong on the other side
|
||||
logger.debug("[{}] received a remote error as a response to ping {}", e, sendPingsHandler.id(), finalNodeToSend);
|
||||
} catch (Throwable e) {
|
||||
logger.warn("[{}] failed send ping to {}", e, sendPingsHandler.id(), finalNodeToSend);
|
||||
} finally {
|
||||
|
|
Loading…
Reference in New Issue