private void stopGracefully(long timeout, TimeUnit timeoutUnit) { if (process == null) { return; } try { // request graceful stop process.askForStop(); process.waitFor(timeout, timeoutUnit); } catch (InterruptedException e) { // can't wait for the termination of process. Let's assume it's down. LOG.warn("Interrupted while stopping process {}", processId, e); Thread.currentThread().interrupt(); } catch (Throwable e) { LOG.error("Can not ask for graceful stop of process {}", processId, e); } }
private void stopGracefully(long timeout, TimeUnit timeoutUnit) { if (process == null) { return; } try { // request graceful stop process.askForStop(); process.waitFor(timeout, timeoutUnit); } catch (InterruptedException e) { // can't wait for the termination of process. Let's assume it's down. LOG.warn("Interrupted while stopping process {}", processId, e); Thread.currentThread().interrupt(); } catch (Throwable e) { LOG.error("Can not ask for graceful stop of process {}", processId, e); } }