{"action":"opened","issue":{"url":"https://api.github.com/repos/docker/docker/issues/16141","labels_url":"https://api.github.com/repos/docker/docker/issues/16141/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/16141/comments","events_url":"https://api.github.com/repos/docker/docker/issues/16141/events","html_url":"https://github.com/docker/docker/issues/16141","id":105381509,"number":16141,"title":"check for cpuset.cpus before set the value","user":{"login":"HuKeping","id":9958621,"avatar_url":"https://avatars.githubusercontent.com/u/9958621?v=3","gravatar_id":"","url":"https://api.github.com/users/HuKeping","html_url":"https://github.com/HuKeping","followers_url":"https://api.github.com/users/HuKeping/followers","following_url":"https://api.github.com/users/HuKeping/following{/other_user}","gists_url":"https://api.github.com/users/HuKeping/gists{/gist_id}","starred_url":"https://api.github.com/users/HuKeping/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/HuKeping/subscriptions","organizations_url":"https://api.github.com/users/HuKeping/orgs","repos_url":"https://api.github.com/users/HuKeping/repos","events_url":"https://api.github.com/users/HuKeping/events{/privacy}","received_events_url":"https://api.github.com/users/HuKeping/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-09-08T13:35:31Z","updated_at":"2015-09-08T13:35:32Z","closed_at":null,"body":"Here comes the example:\r\n\r\nAssume I have 4 CPUs in my host, at the very beginning everything is OK for\r\n```\r\n docker run -ti --name hkp_ubuntu  --cpuset-cpus=0-3 ubuntu bash\r\n```\r\n\r\nThen I put CPU1 off and then put it on\r\n```\r\necho 0 > /sys/devices/system/cpu/cpu1/online\r\n\r\necho 1 > /sys/devices/system/cpu/cpu1/online\r\n```\r\n\r\nLet's check for the cpuset.cpus of cgroup docker\r\n```\r\ncat /sys/fs/cgroup/cpuset/docker/cpuset.cpus\r\n0,2-3\r\n```\r\n\r\nAnd then run that docker CLI again, error happen\r\n```\r\nError response from daemon: Cannot start container 0abdc40d8a96d66318340b863cff56177e4958540839440fb25edb8a57430c51: [8] System error: write /sys/fs/cgroup/cpuset/docker/0abdc40d8a96d66318340b863cff56177e4958540839440fb25edb8a57430c51/cpuset.cpus: invalid argument\r\n```\r\n\r\nThis is because when we shut down CPU1, the cgroup system update all the sub-cgroup system about the cpuset.cpus.  But when the CPU1 comes back it didn't do the same thing."}}