@@ -68,7 +68,8 @@ class StreamGobbler extends Thread { | |||
try { | |||
gobbler.join(); | |||
} catch (InterruptedException ignored) { | |||
// consider as finished | |||
// consider as finished, restore the interrupted flag | |||
Thread.currentThread().interrupt(); | |||
} | |||
} | |||
} |
@@ -135,7 +135,7 @@ public class ProcessEntryPoint implements Stoppable { | |||
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); | |||
} |
@@ -56,6 +56,8 @@ public class StopWatcher extends Thread { | |||
Thread.sleep(delayMs); | |||
} catch (InterruptedException ignored) { | |||
watching = false; | |||
// restore interrupted flag | |||
Thread.currentThread().interrupt(); | |||
} | |||
} | |||
} |
@@ -66,12 +66,13 @@ public class SearchServer implements Monitored { | |||
@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(); | |||
} | |||
} | |||
@@ -147,7 +147,8 @@ public class CommandExecutor { | |||
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(); | |||
} | |||
} | |||
} |