try {
gobbler.join();
} catch (InterruptedException ignored) {
- // consider as finished
+ // consider as finished, restore the interrupted flag
+ Thread.currentThread().interrupt();
}
}
}
stopperThread.join();
lifecycle.tryToMoveTo(Lifecycle.State.STOPPED);
} catch (InterruptedException e) {
- // nothing to do, the process is going to be exited
+ Thread.currentThread().interrupt();
}
exit.exit(0);
}
Thread.sleep(delayMs);
} catch (InterruptedException ignored) {
watching = false;
+ // restore interrupted flag
+ Thread.currentThread().interrupt();
}
}
}
@Override
public void awaitStop() {
- while (node != null && !node.isClosed()) {
- try {
+ try {
+ while (node != null && !node.isClosed()) {
Thread.sleep(200L);
- } catch (InterruptedException e) {
- // Ignore
}
+ } catch (InterruptedException e) {
+ // Restore the interrupted status
+ Thread.currentThread().interrupt();
}
}
try {
thread.join();
} catch (InterruptedException e) {
- LOG.error("InterruptedException while waiting finish of " + thread.toString(), e);
+ // considered as finished, restore the interrupted flag
+ Thread.currentThread().interrupt();
}
}
}