@Test public void verifyMonitorPropagatesImagePullFailed() throws Exception { sut.failed(new ImagePullFailedException("foobar", "failure"), "container error"); verify(statusUpdater).setThrottleState(IMAGE_PULL_FAILED); verify(statusUpdater).setState(FAILED); verify(statusUpdater).setContainerError("container error"); verify(statusUpdater).update(); }
@Override public void failed(final Throwable th, String containerError) { if (th instanceof InterruptedException) { return; } if (th instanceof ImageNotFoundException) { imageFailure(IMAGE_MISSING); } else if (th instanceof ImagePullFailedException) { imageFailure(IMAGE_PULL_FAILED); } statusUpdater.setState(FAILED); statusUpdater.setContainerError(containerError); try { statusUpdater.update(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } }
TaskMonitor implements TaskRunner.Listener, Closeable { @Override public void failed(final Throwable th, String containerError) { if (th instanceof InterruptedException) { return; } if (th instanceof ImageNotFoundException) { imageFailure(IMAGE_MISSING); } else if (th instanceof ImagePullFailedException) { imageFailure(IMAGE_PULL_FAILED); } statusUpdater.setState(FAILED); statusUpdater.setContainerError(containerError); try { statusUpdater.update(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } }
TaskMonitor implements TaskRunner.Listener, Closeable { @Override public void failed(final Throwable th, String containerError) { if (th instanceof InterruptedException) { return; } if (th instanceof ImageNotFoundException) { imageFailure(IMAGE_MISSING); } else if (th instanceof ImagePullFailedException) { imageFailure(IMAGE_PULL_FAILED); } statusUpdater.setState(FAILED); statusUpdater.setContainerError(containerError); try { statusUpdater.update(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } TaskMonitor(final JobId jobId, final FlapController flapController,
                     final StatusUpdater statusUpdater); }
TaskMonitor implements TaskRunner.Listener, Closeable { @Override public void failed(final Throwable th, String containerError) { if (th instanceof InterruptedException) { return; } if (th instanceof ImageNotFoundException) { imageFailure(IMAGE_MISSING); } else if (th instanceof ImagePullFailedException) { imageFailure(IMAGE_PULL_FAILED); } statusUpdater.setState(FAILED); statusUpdater.setContainerError(containerError); try { statusUpdater.update(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } TaskMonitor(final JobId jobId, final FlapController flapController,
                     final StatusUpdater statusUpdater); ThrottleState throttle(); @Override void close(); @Override void failed(final Throwable th, String containerError); @Override void pulling(); @Override void pulled(); @Override void pullFailed(); @Override void creating(); @Override void created(final String containerId); @Override void starting(); @Override void started(); @Override void healthChecking(); @Override void running(); @Override void exited(final long code); }
TaskMonitor implements TaskRunner.Listener, Closeable { @Override public void failed(final Throwable th, String containerError) { if (th instanceof InterruptedException) { return; } if (th instanceof ImageNotFoundException) { imageFailure(IMAGE_MISSING); } else if (th instanceof ImagePullFailedException) { imageFailure(IMAGE_PULL_FAILED); } statusUpdater.setState(FAILED); statusUpdater.setContainerError(containerError); try { statusUpdater.update(); } catch (InterruptedException e) { Thread.currentThread().interrupt(); } } TaskMonitor(final JobId jobId, final FlapController flapController,
                     final StatusUpdater statusUpdater); ThrottleState throttle(); @Override void close(); @Override void failed(final Throwable th, String containerError); @Override void pulling(); @Override void pulled(); @Override void pullFailed(); @Override void creating(); @Override void created(final String containerId); @Override void starting(); @Override void started(); @Override void healthChecking(); @Override void running(); @Override void exited(final long code);  }