{"action":"created","issue":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18073","labels_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18073/labels{/name}","comments_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18073/comments","events_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18073/events","html_url":"https://github.com/kubernetes/kubernetes/pull/18073","id":119941094,"number":18073,"title":"Image garbage collector: LowThresholdPercent can not be higher than HighThresholdPercent","user":{"login":"ingvagabund","id":8055242,"avatar_url":"https://avatars.githubusercontent.com/u/8055242?v=3","gravatar_id":"","url":"https://api.github.com/users/ingvagabund","html_url":"https://github.com/ingvagabund","followers_url":"https://api.github.com/users/ingvagabund/followers","following_url":"https://api.github.com/users/ingvagabund/following{/other_user}","gists_url":"https://api.github.com/users/ingvagabund/gists{/gist_id}","starred_url":"https://api.github.com/users/ingvagabund/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ingvagabund/subscriptions","organizations_url":"https://api.github.com/users/ingvagabund/orgs","repos_url":"https://api.github.com/users/ingvagabund/repos","events_url":"https://api.github.com/users/ingvagabund/events{/privacy}","received_events_url":"https://api.github.com/users/ingvagabund/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/cla:%20yes","name":"cla: yes","color":"bfe5bf"},{"url":"https://api.github.com/repos/kubernetes/kubernetes/labels/size/XS","name":"size/XS","color":"009900"}],"state":"open","locked":false,"assignee":{"login":"dchen1107","id":7740897,"avatar_url":"https://avatars.githubusercontent.com/u/7740897?v=3","gravatar_id":"","url":"https://api.github.com/users/dchen1107","html_url":"https://github.com/dchen1107","followers_url":"https://api.github.com/users/dchen1107/followers","following_url":"https://api.github.com/users/dchen1107/following{/other_user}","gists_url":"https://api.github.com/users/dchen1107/gists{/gist_id}","starred_url":"https://api.github.com/users/dchen1107/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dchen1107/subscriptions","organizations_url":"https://api.github.com/users/dchen1107/orgs","repos_url":"https://api.github.com/users/dchen1107/repos","events_url":"https://api.github.com/users/dchen1107/events{/privacy}","received_events_url":"https://api.github.com/users/dchen1107/received_events","type":"User","site_admin":false},"milestone":null,"comments":2,"created_at":"2015-12-02T13:32:53Z","updated_at":"2015-12-02T14:08:41Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/kubernetes/kubernetes/pulls/18073","html_url":"https://github.com/kubernetes/kubernetes/pull/18073","diff_url":"https://github.com/kubernetes/kubernetes/pull/18073.diff","patch_url":"https://github.com/kubernetes/kubernetes/pull/18073.patch"},"body":"if LowThresholdPercent > HighThresholdPercent, amountToFree at image_manager.go:208 is negative and image GC will not free memory properly.\r\n\r\nJustification:\r\n\r\n1) LowThresholdPercent > HighThresholdPercent implies (LowThresholdPercent * capacity / 100) > (HighThresholdPercent * capacity / 100)\r\n2) usage is at least (HighThresholdPercent * capacity / 100)\r\n3) amountToFree = usage - (LowThresholdPercent * capacity / 100)\r\n\r\nCombining 1), 2) and 3) implies amountToFree can be negative.\r\n\r\nWhat happens if amountToFree is negative? in freeSpace method, \"for _, image := range images \" loops at least once\r\nand if everything goes fine, \"delete(im.imageRecords, image.id)\" is executed.\r\nWhen checking for condition \"if spaceFreed >= bytesToFree\", it is always true as bytesToFree is negative\r\nand spaceFreed is positive. The loop is finished, so is image GC.\r\n\r\nAt the end, only the oldest image is deleted. In situations where there is a lot of dead containers,\r\neach container corresponing to distinct image, number of unused images can get higher.\r\nIf two new images get pulled in every 5 minutes, image GC will not work properly and will not free enough space.\r\nSecondly, it will take a lot of time to free all unused images (hours depending on a number of unused images).\r\n\r\nThis is an incorrect configuration. Image GC should report it and refuse to work."},"comment":{"url":"https://api.github.com/repos/kubernetes/kubernetes/issues/comments/161305846","html_url":"https://github.com/kubernetes/kubernetes/pull/18073#issuecomment-161305846","issue_url":"https://api.github.com/repos/kubernetes/kubernetes/issues/18073","id":161305846,"user":{"login":"k8s-bot","id":12551979,"avatar_url":"https://avatars.githubusercontent.com/u/12551979?v=3","gravatar_id":"","url":"https://api.github.com/users/k8s-bot","html_url":"https://github.com/k8s-bot","followers_url":"https://api.github.com/users/k8s-bot/followers","following_url":"https://api.github.com/users/k8s-bot/following{/other_user}","gists_url":"https://api.github.com/users/k8s-bot/gists{/gist_id}","starred_url":"https://api.github.com/users/k8s-bot/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/k8s-bot/subscriptions","organizations_url":"https://api.github.com/users/k8s-bot/orgs","repos_url":"https://api.github.com/users/k8s-bot/repos","events_url":"https://api.github.com/users/k8s-bot/events{/privacy}","received_events_url":"https://api.github.com/users/k8s-bot/received_events","type":"User","site_admin":false},"created_at":"2015-12-02T14:08:41Z","updated_at":"2015-12-02T14:08:41Z","body":"GCE e2e test build/test **passed** for commit 9590b23264b65f2f89a06b39b5abbaa2c8dece23.\n* [Build Log](https://storage.cloud.google.com/kubernetes-jenkins/pr-logs/9590b23264b65f2f89a06b39b5abbaa2c8dece23/kubernetes-pull-build-test-e2e-gce/18727/build-log.txt)\n* [Test Artifacts](https://console.developers.google.com/storage/browser/kubernetes-jenkins/pr-logs/9590b23264b65f2f89a06b39b5abbaa2c8dece23/kubernetes-pull-build-test-e2e-gce/18727/artifacts/)\n* [Internal Jenkins Results](http://goto.google.com/prkubekins/job/kubernetes-pull-build-test-e2e-gce//18727)\n"}}