diff options
author | Valerij Fredriksen <valerijf@oath.com> | 2019-01-15 14:08:34 +0100 |
---|---|---|
committer | Valerij Fredriksen <valerijf@oath.com> | 2019-01-15 14:08:34 +0100 |
commit | df60882b4f7d5d4ec7fc09872ce92578fb73eec0 (patch) | |
tree | e85794c359ef29151a2c7bc22d1b3639e97fe13d /docker-api/src/main | |
parent | 4f777c975c2e4af4fbbb30a9e547c965595b628b (diff) |
Remove container if resetting CPU cap
Diffstat (limited to 'docker-api/src/main')
-rw-r--r-- | docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/ContainerResources.java | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/ContainerResources.java b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/ContainerResources.java index b8f9cd55f29..64d8fd6a1e8 100644 --- a/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/ContainerResources.java +++ b/docker-api/src/main/java/com/yahoo/vespa/hosted/dockerapi/ContainerResources.java @@ -47,8 +47,10 @@ public class ContainerResources { return cpus; } + // Although docker allows to update cpu quota to 0, this is not a legal value, must be set -1 for unlimited + // See: https://github.com/docker/for-linux/issues/558 public int cpuQuota() { - return (int) (cpus * CPU_PERIOD); + return cpus > 0 ? (int) (cpus * CPU_PERIOD) : -1; } public int cpuPeriod() { |