{"action":"created","issue":{"url":"https://api.github.com/repos/docker/docker/issues/17088","labels_url":"https://api.github.com/repos/docker/docker/issues/17088/labels{/name}","comments_url":"https://api.github.com/repos/docker/docker/issues/17088/comments","events_url":"https://api.github.com/repos/docker/docker/issues/17088/events","html_url":"https://github.com/docker/docker/pull/17088","id":111708224,"number":17088,"title":"Fixing hang in archive.CopyWithTar with invalid dst","user":{"login":"swernli","id":10567287,"avatar_url":"https://avatars.githubusercontent.com/u/10567287?v=3","gravatar_id":"","url":"https://api.github.com/users/swernli","html_url":"https://github.com/swernli","followers_url":"https://api.github.com/users/swernli/followers","following_url":"https://api.github.com/users/swernli/following{/other_user}","gists_url":"https://api.github.com/users/swernli/gists{/gist_id}","starred_url":"https://api.github.com/users/swernli/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/swernli/subscriptions","organizations_url":"https://api.github.com/users/swernli/orgs","repos_url":"https://api.github.com/users/swernli/repos","events_url":"https://api.github.com/users/swernli/events{/privacy}","received_events_url":"https://api.github.com/users/swernli/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/docker/docker/labels/group/windows","name":"group/windows","color":"F6FBFF"},{"url":"https://api.github.com/repos/docker/docker/labels/status/0-triage","name":"status/0-triage","color":"EEEEEE"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-10-15T21:08:52Z","updated_at":"2015-10-15T21:28:34Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/docker/docker/pulls/17088","html_url":"https://github.com/docker/docker/pull/17088","diff_url":"https://github.com/docker/docker/pull/17088.diff","patch_url":"https://github.com/docker/docker/pull/17088.patch"},"body":"@jhowardmsft @jstarks @vbatts @tiborvass \r\n\r\narchive.CopyWithTar can hit a hang if the destination path is invalid (either an invalid path name or an inaccessible folder), because archive.Untar will return the error without closing the Reader pipe but after CopyWithTar has started the go func that is waiting on the pipe.  The fix here is to check the error of archive.Untar and if it failed, explicitly close the pipe to unblock the thread waiting on it.\r\n\r\nThis issue is hard to hit in Linux, since the unit tests run as root and there aren't any invalid directory names we could give, but in Windows simply including \"ADD myfile.txt /invalid:directory/\" in a Dockerfile would cause the build to hang and the handles to the files in the layer to be leaked when the daemon is killed.\r\n\r\nSigned-off-by: Stefan J. Wernli <swernli@microsoft.com>"},"comment":{"url":"https://api.github.com/repos/docker/docker/issues/comments/148526054","html_url":"https://github.com/docker/docker/pull/17088#issuecomment-148526054","issue_url":"https://api.github.com/repos/docker/docker/issues/17088","id":148526054,"user":{"login":"LK4D4","id":101445,"avatar_url":"https://avatars.githubusercontent.com/u/101445?v=3","gravatar_id":"","url":"https://api.github.com/users/LK4D4","html_url":"https://github.com/LK4D4","followers_url":"https://api.github.com/users/LK4D4/followers","following_url":"https://api.github.com/users/LK4D4/following{/other_user}","gists_url":"https://api.github.com/users/LK4D4/gists{/gist_id}","starred_url":"https://api.github.com/users/LK4D4/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/LK4D4/subscriptions","organizations_url":"https://api.github.com/users/LK4D4/orgs","repos_url":"https://api.github.com/users/LK4D4/repos","events_url":"https://api.github.com/users/LK4D4/events{/privacy}","received_events_url":"https://api.github.com/users/LK4D4/received_events","type":"User","site_admin":false},"created_at":"2015-10-15T21:28:34Z","updated_at":"2015-10-15T21:28:34Z","body":"LGTM"}}