{"action":"created","comment":{"url":"https://api.github.com/repos/docker/docker/pulls/comments/26867154","id":26867154,"diff_hunk":"@@ -1068,6 +1068,9 @@ The archive may include any number of other files,\n which will be accessible in the build context (See the [*ADD build\n command*](/reference/builder/#dockerbuilder)).\n \n+The build will also be canceled if the client drops the connection by quitting","path":"docs/sources/reference/api/docker_remote_api_v1.17.md","position":null,"original_position":4,"commit_id":"1f69b2ac483e20f5a5ccd1c80fc5f93e876caff7","original_commit_id":"6ee4a76849c1a1b40d92e1bb30cd6b9e2a1f0d62","user":{"login":"pwaller","id":438648,"avatar_url":"https://avatars.githubusercontent.com/u/438648?v=3","gravatar_id":"","url":"https://api.github.com/users/pwaller","html_url":"https://github.com/pwaller","followers_url":"https://api.github.com/users/pwaller/followers","following_url":"https://api.github.com/users/pwaller/following{/other_user}","gists_url":"https://api.github.com/users/pwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/pwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwaller/subscriptions","organizations_url":"https://api.github.com/users/pwaller/orgs","repos_url":"https://api.github.com/users/pwaller/repos","events_url":"https://api.github.com/users/pwaller/events{/privacy}","received_events_url":"https://api.github.com/users/pwaller/received_events","type":"User","site_admin":false},"body":"Fixed. Good spot :)","created_at":"2015-03-20T19:02:26Z","updated_at":"2015-03-20T19:02:26Z","html_url":"https://github.com/docker/docker/pull/9774#discussion_r26867154","pull_request_url":"https://api.github.com/repos/docker/docker/pulls/9774","_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/comments/26867154"},"html":{"href":"https://github.com/docker/docker/pull/9774#discussion_r26867154"},"pull_request":{"href":"https://api.github.com/repos/docker/docker/pulls/9774"}}},"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/9774","id":26450379,"html_url":"https://github.com/docker/docker/pull/9774","diff_url":"https://github.com/docker/docker/pull/9774.diff","patch_url":"https://github.com/docker/docker/pull/9774.patch","issue_url":"https://api.github.com/repos/docker/docker/issues/9774","number":9774,"state":"open","locked":false,"title":"Add basic build cancellation","user":{"login":"pwaller","id":438648,"avatar_url":"https://avatars.githubusercontent.com/u/438648?v=3","gravatar_id":"","url":"https://api.github.com/users/pwaller","html_url":"https://github.com/pwaller","followers_url":"https://api.github.com/users/pwaller/followers","following_url":"https://api.github.com/users/pwaller/following{/other_user}","gists_url":"https://api.github.com/users/pwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/pwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwaller/subscriptions","organizations_url":"https://api.github.com/users/pwaller/orgs","repos_url":"https://api.github.com/users/pwaller/repos","events_url":"https://api.github.com/users/pwaller/events{/privacy}","received_events_url":"https://api.github.com/users/pwaller/received_events","type":"User","site_admin":false},"body":"Cancelling the build is a desirable function. For example, let's say one wanted\r\nto hook up inotify to trigger a build/run cycle when code was edited. At the\r\nmoment if there were multiple changes in quick succession, you would end up\r\nwith many in-flight builds contending with each other, and no way to cancel\r\nthem other than restarting the docker daemon.\r\n\r\nThis PR has been optimised for being the smallest useful change. It does not\r\nrepresent the full changes needed to cancel in all circumstances yet. That\r\nwill come later, first I hope to disseminate some understanding of how to\r\nachieve this.\r\n\r\nCurrently it only allows cancellation during the command running phase. If the\r\ncommand is a `RUN` statement, the container is killed. Other statements are\r\nnot currently interrupted but instead the build is cancelled just before\r\nthe next statement.\r\n\r\nCancellation can be used by non-docker clients by cancelling the http request.\r\nThere is an example of how to do that here:\r\n\r\nhttps://github.com/fsouza/go-dockerclient/pull/183\r\n\r\n---\r\n\r\nAdd the capability to cancel the build by disconnecting the client.\r\n\r\nThis adds a `cancelled` channel which is used to signal that a build\r\nshould halt. The build is halted by sending a Kill signal and noticing\r\nthat the cancellation channel is closed.\r\n\r\nThis first pass implementation does not allow cancellation during a\r\npull, but that will come in a subsequent PR.\r\n\r\nSee also:\r\nhttps://github.com/docker/docker/issues/3654\r\nhttps://github.com/docker/docker/issues/6928\r\n\r\nNext on my TODO list will be to implement the same thing in a similar style\r\nfor `docker pull`, if this PR is accepted. That change will automatically\r\nmake the pull phase of builds cancellable, too.\r\n\r\nDocker-DCO-1.1-Signed-off-by: Peter Waller <p@pwaller.net> (github: pwaller)","created_at":"2014-12-22T11:00:48Z","updated_at":"2015-03-20T19:02:26Z","closed_at":null,"merged_at":null,"merge_commit_sha":"0f15d5164aac22f44bb2b83df04b2575404799fd","assignee":null,"milestone":{"url":"https://api.github.com/repos/docker/docker/milestones/37","html_url":"https://github.com/docker/docker/milestones/1.6.0","labels_url":"https://api.github.com/repos/docker/docker/milestones/37/labels","id":952335,"number":37,"title":"1.6.0","description":"","creator":{"login":"crosbymichael","id":749551,"avatar_url":"https://avatars.githubusercontent.com/u/749551?v=3","gravatar_id":"","url":"https://api.github.com/users/crosbymichael","html_url":"https://github.com/crosbymichael","followers_url":"https://api.github.com/users/crosbymichael/followers","following_url":"https://api.github.com/users/crosbymichael/following{/other_user}","gists_url":"https://api.github.com/users/crosbymichael/gists{/gist_id}","starred_url":"https://api.github.com/users/crosbymichael/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/crosbymichael/subscriptions","organizations_url":"https://api.github.com/users/crosbymichael/orgs","repos_url":"https://api.github.com/users/crosbymichael/repos","events_url":"https://api.github.com/users/crosbymichael/events{/privacy}","received_events_url":"https://api.github.com/users/crosbymichael/received_events","type":"User","site_admin":false},"open_issues":27,"closed_issues":60,"state":"open","created_at":"2015-01-26T23:40:13Z","updated_at":"2015-03-20T18:27:18Z","due_on":"2015-03-23T07:00:00Z","closed_at":null},"commits_url":"https://api.github.com/repos/docker/docker/pulls/9774/commits","review_comments_url":"https://api.github.com/repos/docker/docker/pulls/9774/comments","review_comment_url":"https://api.github.com/repos/docker/docker/pulls/comments{/number}","comments_url":"https://api.github.com/repos/docker/docker/issues/9774/comments","statuses_url":"https://api.github.com/repos/docker/docker/statuses/1f69b2ac483e20f5a5ccd1c80fc5f93e876caff7","head":{"label":"pwaller:cancellation","ref":"cancellation","sha":"1f69b2ac483e20f5a5ccd1c80fc5f93e876caff7","user":{"login":"pwaller","id":438648,"avatar_url":"https://avatars.githubusercontent.com/u/438648?v=3","gravatar_id":"","url":"https://api.github.com/users/pwaller","html_url":"https://github.com/pwaller","followers_url":"https://api.github.com/users/pwaller/followers","following_url":"https://api.github.com/users/pwaller/following{/other_user}","gists_url":"https://api.github.com/users/pwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/pwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwaller/subscriptions","organizations_url":"https://api.github.com/users/pwaller/orgs","repos_url":"https://api.github.com/users/pwaller/repos","events_url":"https://api.github.com/users/pwaller/events{/privacy}","received_events_url":"https://api.github.com/users/pwaller/received_events","type":"User","site_admin":false},"repo":{"id":16286332,"name":"docker","full_name":"pwaller/docker","owner":{"login":"pwaller","id":438648,"avatar_url":"https://avatars.githubusercontent.com/u/438648?v=3","gravatar_id":"","url":"https://api.github.com/users/pwaller","html_url":"https://github.com/pwaller","followers_url":"https://api.github.com/users/pwaller/followers","following_url":"https://api.github.com/users/pwaller/following{/other_user}","gists_url":"https://api.github.com/users/pwaller/gists{/gist_id}","starred_url":"https://api.github.com/users/pwaller/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pwaller/subscriptions","organizations_url":"https://api.github.com/users/pwaller/orgs","repos_url":"https://api.github.com/users/pwaller/repos","events_url":"https://api.github.com/users/pwaller/events{/privacy}","received_events_url":"https://api.github.com/users/pwaller/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/pwaller/docker","description":"Docker - the open-source application container engine","fork":true,"url":"https://api.github.com/repos/pwaller/docker","forks_url":"https://api.github.com/repos/pwaller/docker/forks","keys_url":"https://api.github.com/repos/pwaller/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pwaller/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pwaller/docker/teams","hooks_url":"https://api.github.com/repos/pwaller/docker/hooks","issue_events_url":"https://api.github.com/repos/pwaller/docker/issues/events{/number}","events_url":"https://api.github.com/repos/pwaller/docker/events","assignees_url":"https://api.github.com/repos/pwaller/docker/assignees{/user}","branches_url":"https://api.github.com/repos/pwaller/docker/branches{/branch}","tags_url":"https://api.github.com/repos/pwaller/docker/tags","blobs_url":"https://api.github.com/repos/pwaller/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pwaller/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pwaller/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/pwaller/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pwaller/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/pwaller/docker/languages","stargazers_url":"https://api.github.com/repos/pwaller/docker/stargazers","contributors_url":"https://api.github.com/repos/pwaller/docker/contributors","subscribers_url":"https://api.github.com/repos/pwaller/docker/subscribers","subscription_url":"https://api.github.com/repos/pwaller/docker/subscription","commits_url":"https://api.github.com/repos/pwaller/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/pwaller/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/pwaller/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/pwaller/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/pwaller/docker/contents/{+path}","compare_url":"https://api.github.com/repos/pwaller/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pwaller/docker/merges","archive_url":"https://api.github.com/repos/pwaller/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pwaller/docker/downloads","issues_url":"https://api.github.com/repos/pwaller/docker/issues{/number}","pulls_url":"https://api.github.com/repos/pwaller/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/pwaller/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/pwaller/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pwaller/docker/labels{/name}","releases_url":"https://api.github.com/repos/pwaller/docker/releases{/id}","created_at":"2014-01-27T17:22:29Z","updated_at":"2015-03-10T18:23:39Z","pushed_at":"2015-03-20T19:02:21Z","git_url":"git://github.com/pwaller/docker.git","ssh_url":"git@github.com:pwaller/docker.git","clone_url":"https://github.com/pwaller/docker.git","svn_url":"https://github.com/pwaller/docker","homepage":"http://www.docker.io","size":45581,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"docker:master","ref":"master","sha":"79744811623cc794d028abfc70ac3f58db9f4b9b","user":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"repo":{"id":7691631,"name":"docker","full_name":"docker/docker","owner":{"login":"docker","id":5429470,"avatar_url":"https://avatars.githubusercontent.com/u/5429470?v=3","gravatar_id":"","url":"https://api.github.com/users/docker","html_url":"https://github.com/docker","followers_url":"https://api.github.com/users/docker/followers","following_url":"https://api.github.com/users/docker/following{/other_user}","gists_url":"https://api.github.com/users/docker/gists{/gist_id}","starred_url":"https://api.github.com/users/docker/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/docker/subscriptions","organizations_url":"https://api.github.com/users/docker/orgs","repos_url":"https://api.github.com/users/docker/repos","events_url":"https://api.github.com/users/docker/events{/privacy}","received_events_url":"https://api.github.com/users/docker/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/docker/docker","description":"Docker - the open-source application container engine","fork":false,"url":"https://api.github.com/repos/docker/docker","forks_url":"https://api.github.com/repos/docker/docker/forks","keys_url":"https://api.github.com/repos/docker/docker/keys{/key_id}","collaborators_url":"https://api.github.com/repos/docker/docker/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/docker/docker/teams","hooks_url":"https://api.github.com/repos/docker/docker/hooks","issue_events_url":"https://api.github.com/repos/docker/docker/issues/events{/number}","events_url":"https://api.github.com/repos/docker/docker/events","assignees_url":"https://api.github.com/repos/docker/docker/assignees{/user}","branches_url":"https://api.github.com/repos/docker/docker/branches{/branch}","tags_url":"https://api.github.com/repos/docker/docker/tags","blobs_url":"https://api.github.com/repos/docker/docker/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/docker/docker/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/docker/docker/git/refs{/sha}","trees_url":"https://api.github.com/repos/docker/docker/git/trees{/sha}","statuses_url":"https://api.github.com/repos/docker/docker/statuses/{sha}","languages_url":"https://api.github.com/repos/docker/docker/languages","stargazers_url":"https://api.github.com/repos/docker/docker/stargazers","contributors_url":"https://api.github.com/repos/docker/docker/contributors","subscribers_url":"https://api.github.com/repos/docker/docker/subscribers","subscription_url":"https://api.github.com/repos/docker/docker/subscription","commits_url":"https://api.github.com/repos/docker/docker/commits{/sha}","git_commits_url":"https://api.github.com/repos/docker/docker/git/commits{/sha}","comments_url":"https://api.github.com/repos/docker/docker/comments{/number}","issue_comment_url":"https://api.github.com/repos/docker/docker/issues/comments{/number}","contents_url":"https://api.github.com/repos/docker/docker/contents/{+path}","compare_url":"https://api.github.com/repos/docker/docker/compare/{base}...{head}","merges_url":"https://api.github.com/repos/docker/docker/merges","archive_url":"https://api.github.com/repos/docker/docker/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/docker/docker/downloads","issues_url":"https://api.github.com/repos/docker/docker/issues{/number}","pulls_url":"https://api.github.com/repos/docker/docker/pulls{/number}","milestones_url":"https://api.github.com/repos/docker/docker/milestones{/number}","notifications_url":"https://api.github.com/repos/docker/docker/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/docker/docker/labels{/name}","releases_url":"https://api.github.com/repos/docker/docker/releases{/id}","created_at":"2013-01-18T18:10:57Z","updated_at":"2015-03-20T19:00:40Z","pushed_at":"2015-03-20T19:02:25Z","git_url":"git://github.com/docker/docker.git","ssh_url":"git@github.com:docker/docker.git","clone_url":"https://github.com/docker/docker.git","svn_url":"https://github.com/docker/docker","homepage":"http://www.docker.com","size":156144,"stargazers_count":19998,"watchers_count":19998,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":4215,"mirror_url":null,"open_issues_count":798,"forks":4215,"open_issues":798,"watchers":19998,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/docker/docker/pulls/9774"},"html":{"href":"https://github.com/docker/docker/pull/9774"},"issue":{"href":"https://api.github.com/repos/docker/docker/issues/9774"},"comments":{"href":"https://api.github.com/repos/docker/docker/issues/9774/comments"},"review_comments":{"href":"https://api.github.com/repos/docker/docker/pulls/9774/comments"},"review_comment":{"href":"https://api.github.com/repos/docker/docker/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/docker/docker/pulls/9774/commits"},"statuses":{"href":"https://api.github.com/repos/docker/docker/statuses/1f69b2ac483e20f5a5ccd1c80fc5f93e876caff7"}}}}