{"action":"opened","issue":{"url":"https://api.github.com/repos/rancher/rancher/issues/6826","repository_url":"https://api.github.com/repos/rancher/rancher","labels_url":"https://api.github.com/repos/rancher/rancher/issues/6826/labels{/name}","comments_url":"https://api.github.com/repos/rancher/rancher/issues/6826/comments","events_url":"https://api.github.com/repos/rancher/rancher/issues/6826/events","html_url":"https://github.com/rancher/rancher/issues/6826","id":192424388,"number":6826,"title":"DB Cleanup thread leaves behind some instances and their relate services and environments","user":{"login":"cjellick","id":2473240,"avatar_url":"https://avatars.githubusercontent.com/u/2473240?v=3","gravatar_id":"","url":"https://api.github.com/users/cjellick","html_url":"https://github.com/cjellick","followers_url":"https://api.github.com/users/cjellick/followers","following_url":"https://api.github.com/users/cjellick/following{/other_user}","gists_url":"https://api.github.com/users/cjellick/gists{/gist_id}","starred_url":"https://api.github.com/users/cjellick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cjellick/subscriptions","organizations_url":"https://api.github.com/users/cjellick/orgs","repos_url":"https://api.github.com/users/cjellick/repos","events_url":"https://api.github.com/users/cjellick/events{/privacy}","received_events_url":"https://api.github.com/users/cjellick/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-11-29T22:47:11Z","updated_at":"2016-11-29T22:47:11Z","closed_at":null,"body":"The cleanup thread we have deletes resources that have been marked removed and whose deletion wont violate any foreign key constraints. Because some volumes and mount are not automatically removed by rancher, this causes their associated instances to not get cleaned up by the thread.\r\n\r\n**Rancher Version:**\r\nreally close to 1.2\r\n\r\n**Steps to Reproduce:**\r\n1. Create an environment with a service that has a container with a host bind mount (ie `docker run -v /tmp:/host/tmp ...`)\r\n2. Delete the environment, wait for container to purge.\r\n3. Wait until you are passed the cleanup time period (default is two weeks, so modify the setting)\r\n4. Restart rancher server to initiate cleanup task.\r\n\r\nAs said, there is no real bug in the cleanup logic. It is behaving as expected, but we done remove mounts until the volume is deleted and we dont automatically delete host bind mount volumes. So, because the instance has an active relationship to the mount table, it cannot be cleaned up. And since it isn't cleaned up, service_expose_map, service, and environment are not cleaned up.\r\n\r\nIf we want to address this, we have to modify the life cycle of instances/volumes/mounts. Or at the very least surface host bind mounted volumes in the UI so that users can choose to remove them."}}
{"actor":{"display_login":"cjellick"}}