log exceptions while trying to pause task (#3504)

This commit is contained in:
Parag Jain 2016-09-23 18:53:23 -05:00 committed by Slim
parent d5a8a35fec
commit 15c9918c65
1 changed files with 4 additions and 0 deletions

View File

@ -176,6 +176,7 @@ public class KafkaIndexTaskClient
);
if (response.getStatus().equals(HttpResponseStatus.OK)) {
log.info("Task [%s] paused successfully", id);
return jsonMapper.readValue(response.getContent(), new TypeReference<Map<Integer, Long>>() {});
}
@ -187,6 +188,7 @@ public class KafkaIndexTaskClient
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();
@ -200,9 +202,11 @@ public class KafkaIndexTaskClient
}
}
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);
}
}