Skip to content

Commit

Permalink
Relax disk space checking to not abort in cases where df output sho…
Browse files Browse the repository at this point in the history
…ws no available volumes (see #273). While the cause is not known, and Docker may yet fail, relaxing this constraint at least lets Docker try without aborting prematurely.
  • Loading branch information
rnorth committed Jan 21, 2017
1 parent 638e4d0 commit d2e4153
Showing 1 changed file with 1 addition and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ private void checkDiskSpace(DockerClient client) {
df.usedPercent.map(x -> x.toString() + "%").orElse("unknown"),
df.availableMB.map(x -> x.toString() + " MB available").orElse("unknown available"));

if (df.availableMB.orElseThrow(NotAbleToGetDiskSpaceUsageException::new) < 2048) {
if (df.availableMB.isPresent() && df.availableMB.get() < 2048) {
LOGGER.error("Docker environment has less than 2GB free - execution is unlikely to succeed so will be aborted.");
throw new NotEnoughDiskSpaceException("Not enough disk space in Docker environment");
}
Expand Down Expand Up @@ -224,12 +224,6 @@ private static class NotEnoughDiskSpaceException extends RuntimeException {
super(message);
}
}

private static class NotAbleToGetDiskSpaceUsageException extends RuntimeException {
NotAbleToGetDiskSpaceUsageException() {
super();
}
}
}

class LogContainerCallback extends LogContainerResultCallback {
Expand Down

0 comments on commit d2e4153

Please sign in to comment.