Skip to content

Commit

Permalink
Merge pull request #925 from HubSpot/mesos-oom2
Browse files Browse the repository at this point in the history
get memory info from deploy object instead of mesos task resources
  • Loading branch information
ssalinas committed Mar 17, 2016
2 parents a785fad + 9efcdb7 commit 61a2baf
Showing 1 changed file with 2 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -306,11 +306,8 @@ private Optional<String> getStatusMessage(Protos.TaskStatus status, Optional<Sin
if (status.hasMessage() && !Strings.isNullOrEmpty(status.getMessage())) {
return Optional.of(status.getMessage());
} else if (status.hasReason() && status.getReason() == Protos.TaskStatus.Reason.REASON_MEMORY_LIMIT) {
if (task.isPresent()) {
final double memory = MesosUtils.getMemory(task.get().getMesosTask().getResourcesList());
if (memory > 0) {
return Optional.of(String.format("Task exceeded memory limit of %s MB", MesosUtils.getMemory(task.get().getMesosTask().getResourcesList())));
}
if (task.isPresent() && task.get().getTaskRequest().getDeploy().getResources().isPresent()) {
return Optional.of(String.format("Task exceeded memory limit of %s MB", task.get().getTaskRequest().getDeploy().getResources().get().getMemoryMb()));
}
return Optional.of("Task exceeded memory limit");
}
Expand Down

0 comments on commit 61a2baf

Please # to comment.