HDDS-1387. ConcurrentModificationException in TestMiniChaosOzoneCluster. Contributed by Marton Elek. (#732)

This commit is contained in:
Elek, Márton 2019-04-13 00:19:50 +02:00 committed by Arpit Agarwal
parent 62f4808617
commit 5379d85d8e

View File

@ -136,11 +136,13 @@ void stopChaos() throws Exception {
} }
public void shutdown() { public void shutdown() {
super.shutdown();
try { try {
stopChaos(); stopChaos();
executorService.shutdown(); executorService.shutdown();
executorService.awaitTermination(1, TimeUnit.DAYS); executorService.awaitTermination(1, TimeUnit.DAYS);
//this should be called after stopChaos to be sure that the
//datanode collection is not modified during the shutdown
super.shutdown();
} catch (Exception e) { } catch (Exception e) {
LOG.error("failed to shutdown MiniOzoneChaosCluster", e); LOG.error("failed to shutdown MiniOzoneChaosCluster", e);
} }