Don't swallow IOExceptions in InternalTestCluster. (#39068)

Relates #39030
This commit is contained in:
Adrien Grand 2019-02-19 15:03:47 +01:00 committed by GitHub
parent 7f8a640363
commit d8852b83d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 7 additions and 4 deletions

View File

@ -844,15 +844,18 @@ public final class InternalTestCluster extends TestCluster {
}
@Override
public synchronized void close() {
public synchronized void close() throws IOException {
if (this.open.compareAndSet(true, false)) {
if (activeDisruptionScheme != null) {
activeDisruptionScheme.testClusterClosed();
activeDisruptionScheme = null;
}
IOUtils.closeWhileHandlingException(nodes.values());
nodes.clear();
executor.shutdownNow();
try {
IOUtils.close(nodes.values());
} finally {
nodes.clear();
executor.shutdownNow();
}
}
}