{"action":"created","issue":{"url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/415","labels_url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/415/labels{/name}","comments_url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/415/comments","events_url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/415/events","html_url":"https://github.com/fsouza/go-dockerclient/issues/415","id":116921524,"number":415,"title":"AttachToContainer hangs or returns prematurely with binary streams","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},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-11-14T12:11:55Z","updated_at":"2015-11-16T14:36:51Z","closed_at":"2015-11-16T14:36:51Z","body":"This is a followup to what I posted in #209.\r\n\r\nI've [written a minimal reproducer](https://gist.github.com/pwaller/314c7591a8bfd32f8999/fabc0320618d9170426e890611c7131c10baa980) which reliably hits the problem.\r\n\r\nGrab it:\r\n```\r\n$ go get -v gist.github.com/314c7591a8bfd32f8999.git\r\n```\r\n\r\nThere are two problems. The first is that the output is reliably not the correct length:\r\n\r\n```\r\n$ 314c7591a8bfd32f8999.git debian:wheezy cat /bin/bash | wc -c\r\n41051\r\n$ docker run --rm debian:wheezy cat /bin/bash | wc -c\r\n975488\r\n```\r\n\r\nSecondly, sometimes it just freezes mid stream:\r\n\r\n```\r\n$ while sleep 0.1; do 314c7591a8bfd32f8999.git debian:wheezy cat /bin/bash | wc -c; done\r\n[runs a few times before hanging]\r\n```\r\n\r\nNote: I've reproduced this on docker 1.7.1 (reliably returns zero bytes) 1.8.3 (hangs sometimes, reliably returns 41,051 bytes) and 1.9.0 (hangs more frequently, I've seen it return 41,051 bytes and also 1,519 bytes)."},"comment":{"url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/comments/157050514","html_url":"https://github.com/fsouza/go-dockerclient/issues/415#issuecomment-157050514","issue_url":"https://api.github.com/repos/fsouza/go-dockerclient/issues/415","id":157050514,"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},"created_at":"2015-11-16T14:36:51Z","updated_at":"2015-11-16T14:36:51Z","body":"OK. I'm going to close this one in favour of #161."}}