{"action":"created","issue":{"url":"https://api.github.com/repos/docker/swarm/issues/1212","labels_url":"https://api.github.com/repos/docker/swarm/issues/1212/labels{/name}","comments_url":"https://api.github.com/repos/docker/swarm/issues/1212/comments","events_url":"https://api.github.com/repos/docker/swarm/issues/1212/events","html_url":"https://github.com/docker/swarm/pull/1212","id":106459438,"number":1212,"title":"WIP: Remove the lock at the scheduler level","user":{"login":"abronan","id":1655859,"avatar_url":"https://avatars.githubusercontent.com/u/1655859?v=3","gravatar_id":"","url":"https://api.github.com/users/abronan","html_url":"https://github.com/abronan","followers_url":"https://api.github.com/users/abronan/followers","following_url":"https://api.github.com/users/abronan/following{/other_user}","gists_url":"https://api.github.com/users/abronan/gists{/gist_id}","starred_url":"https://api.github.com/users/abronan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abronan/subscriptions","organizations_url":"https://api.github.com/users/abronan/orgs","repos_url":"https://api.github.com/users/abronan/repos","events_url":"https://api.github.com/users/abronan/events{/privacy}","received_events_url":"https://api.github.com/users/abronan/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/swarm/labels/status/0-triage","name":"status/0-triage","color":"009800"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-09-15T01:40:54Z","updated_at":"2015-10-09T20:08:31Z","closed_at":"2015-10-09T20:08:31Z","pull_request":{"url":"https://api.github.com/repos/docker/swarm/pulls/1212","html_url":"https://github.com/docker/swarm/pull/1212","diff_url":"https://github.com/docker/swarm/pull/1212.diff","patch_url":"https://github.com/docker/swarm/pull/1212.patch"},"body":"fixes #1194 #786 \r\n\r\nThis PR removes the `Lock` at the `scheduler` level and moves it to `node.Node` for better granularity. `cluster` now maintains a list of Nodes with resource accounting protected by a `Lock` which avoids races for resource reservation. Processes not lucky enough to get a resource slice on a machine that gets full in the meantime are retrying the process of scheduling unless they get the resources they need (it fails if there is no more resource available cluster-wide).\r\n\r\nThis is I think the most simple approach to remove the `lock` at the scheduler level for now and avoid the races. Note that this does not solve the naming issue (we should settle if we allow duplicate names and solve the ambiguity through the prefix which is the node name or if each container must absolutely have a unique name).\r\n\r\n*Downside*: The blocked `pull` problem still persists so some resources are going to be locked up for a while if this happens because we have no way to know if this is due to the issue or just a *very slow* `pull`.\r\n\r\nTODO items:\r\n- [ ] Integration tests\r\n- [ ] Take a look at the implications on strategies and constraints, and parallel create/remove/build\r\n\r\nSigned-off-by: Alexandre Beslic <abronan@docker.com>"},"comment":{"url":"https://api.github.com/repos/docker/swarm/issues/comments/146975185","html_url":"https://github.com/docker/swarm/pull/1212#issuecomment-146975185","issue_url":"https://api.github.com/repos/docker/swarm/issues/1212","id":146975185,"user":{"login":"abronan","id":1655859,"avatar_url":"https://avatars.githubusercontent.com/u/1655859?v=3","gravatar_id":"","url":"https://api.github.com/users/abronan","html_url":"https://github.com/abronan","followers_url":"https://api.github.com/users/abronan/followers","following_url":"https://api.github.com/users/abronan/following{/other_user}","gists_url":"https://api.github.com/users/abronan/gists{/gist_id}","starred_url":"https://api.github.com/users/abronan/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/abronan/subscriptions","organizations_url":"https://api.github.com/users/abronan/orgs","repos_url":"https://api.github.com/users/abronan/repos","events_url":"https://api.github.com/users/abronan/events{/privacy}","received_events_url":"https://api.github.com/users/abronan/received_events","type":"User","site_admin":false},"created_at":"2015-10-09T20:08:31Z","updated_at":"2015-10-09T20:08:31Z","body":"Closing this one in favor of #1261, will maybe revisit for 0.6 but until then the solution in #1261 plays nicer with scheduler plugins while this one could've ended with some side effects."}}