Skip to content

Commit

Permalink
log exceptions while trying to pause task (apache#3504)
Browse files Browse the repository at this point in the history
  • Loading branch information
pjain1 authored and b-slim committed Sep 23, 2016
1 parent d5a8a35 commit 15c9918
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -176,6 +176,7 @@ public Map<Integer, Long> pause(final String id, final long timeout)
);

if (response.getStatus().equals(HttpResponseStatus.OK)) {
log.info("Task [%s] paused successfully", id);
return jsonMapper.readValue(response.getContent(), new TypeReference<Map<Integer, Long>>() {});
}

Expand All @@ -187,6 +188,7 @@ public Map<Integer, Long> pause(final String id, final long timeout)

final Duration delay = retryPolicy.getAndIncrementRetryDelay();
if (delay == null) {
log.error("Task [%s] failed to pause, aborting", id);
throw new ISE("Task [%s] failed to pause, aborting", id);
} else {
final long sleepTime = delay.getMillis();
Expand All @@ -200,9 +202,11 @@ public Map<Integer, Long> pause(final String id, final long timeout)
}
}
catch (NoTaskLocationException e) {
log.error("Exception [%s] while pausing Task [%s]", e.getMessage(), id);
return ImmutableMap.of();
}
catch (IOException | InterruptedException e) {
log.error("Exception [%s] while pausing Task [%s]", e.getMessage(), id);
throw Throwables.propagate(e);
}
}
Expand Down

0 comments on commit 15c9918

Please sign in to comment.