{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/9946","labels_url":"https://api.github.com/repos/golang/go/issues/9946/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/9946/comments","events_url":"https://api.github.com/repos/golang/go/issues/9946/events","html_url":"https://github.com/golang/go/issues/9946","id":58390553,"number":9946,"title":"net/http: data race in closing http.Response.Body when still reading it","user":{"login":"yichengq","id":2976232,"avatar_url":"https://avatars.githubusercontent.com/u/2976232?v=3","gravatar_id":"","url":"https://api.github.com/users/yichengq","html_url":"https://github.com/yichengq","followers_url":"https://api.github.com/users/yichengq/followers","following_url":"https://api.github.com/users/yichengq/following{/other_user}","gists_url":"https://api.github.com/users/yichengq/gists{/gist_id}","starred_url":"https://api.github.com/users/yichengq/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/yichengq/subscriptions","organizations_url":"https://api.github.com/users/yichengq/orgs","repos_url":"https://api.github.com/users/yichengq/repos","events_url":"https://api.github.com/users/yichengq/events{/privacy}","received_events_url":"https://api.github.com/users/yichengq/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/golang/go/labels/RaceReport","name":"RaceReport","color":"ededed"}],"state":"open","locked":false,"assignee":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/1","html_url":"https://github.com/golang/go/milestones/Go1.5","labels_url":"https://api.github.com/repos/golang/go/milestones/1/labels","id":905105,"number":1,"title":"Go1.5","description":"","creator":{"login":"bradfitz","id":2621,"avatar_url":"https://avatars.githubusercontent.com/u/2621?v=3","gravatar_id":"","url":"https://api.github.com/users/bradfitz","html_url":"https://github.com/bradfitz","followers_url":"https://api.github.com/users/bradfitz/followers","following_url":"https://api.github.com/users/bradfitz/following{/other_user}","gists_url":"https://api.github.com/users/bradfitz/gists{/gist_id}","starred_url":"https://api.github.com/users/bradfitz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bradfitz/subscriptions","organizations_url":"https://api.github.com/users/bradfitz/orgs","repos_url":"https://api.github.com/users/bradfitz/repos","events_url":"https://api.github.com/users/bradfitz/events{/privacy}","received_events_url":"https://api.github.com/users/bradfitz/received_events","type":"User","site_admin":false},"open_issues":332,"closed_issues":319,"state":"open","created_at":"2014-12-16T02:26:41Z","updated_at":"2015-04-19T11:01:22Z","due_on":"2015-07-31T04:00:00Z","closed_at":null},"comments":4,"created_at":"2015-02-20T18:20:03Z","updated_at":"2015-04-19T14:18:31Z","closed_at":null,"body":"```\r\n> ==================\r\n> WARNING: DATA RACE\r\n> Write by goroutine 499:\r\n>   net/http.(*persistConn).readLoop()\r\n>       /usr/local/go/src/net/http/transport.go:929 +0xdb8\r\n>\r\n> Previous read by goroutine 189:\r\n>   net/http.func·024()\r\n>       /usr/local/go/src/net/http/transport.go:910 +0x4c\r\n>   net/http.(*bodyEOFSignal).condfn()\r\n>       /usr/local/go/src/net/http/transport.go:1228 +0x105\r\n>   net/http.(*bodyEOFSignal).Read()\r\n>       /usr/local/go/src/net/http/transport.go:1200 +0x41c\r\n>   io.ReadAtLeast()\r\n>       /usr/local/go/src/io/io.go:298 +0x128\r\n>   io.ReadFull()\r\n>       /usr/local/go/src/io/io.go:316 +0x7d\r\n>   encoding/binary.Read()\r\n>       /usr/local/go/src/encoding/binary/binary.go:148 +0x14f\r\n>   github.com/coreos/etcd/rafthttp.(*msgAppDecoder).decode()\r\n>       /Users/unihorn/gopath/src/github.com/coreos/etcd/rafthttp/msgapp.go:66\r\n> +0x13c\r\n>   github.com/coreos/etcd/rafthttp.(*streamReader).run()\r\n>\r\n> /Users/unihorn/gopath/src/github.com/coreos/etcd/rafthttp/stream.go:309\r\n> +0x387\r\n>   runtime.goexit()\r\n>       /usr/local/go/src/runtime/asm_amd64.s:2232 +0x0\r\n>   net/http.func·008()\r\n>       /usr/local/go/src/net/http/server.go:171 +0xb6\r\n>\r\n> Goroutine 499 (running) created at:\r\n>   net/http.(*Transport).dialConn()\r\n>       /usr/local/go/src/net/http/transport.go:660 +0x10d4\r\n>   net/http.func·019()\r\n>       /usr/local/go/src/net/http/transport.go:520 +0x8d\r\n```\r\n\r\nThey share a `alive` variable, and this may be the problem.\r\n\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/94280382","html_url":"https://github.com/golang/go/issues/9946#issuecomment-94280382","issue_url":"https://api.github.com/repos/golang/go/issues/9946","id":94280382,"user":{"login":"DanielMorsing","id":545573,"avatar_url":"https://avatars.githubusercontent.com/u/545573?v=3","gravatar_id":"","url":"https://api.github.com/users/DanielMorsing","html_url":"https://github.com/DanielMorsing","followers_url":"https://api.github.com/users/DanielMorsing/followers","following_url":"https://api.github.com/users/DanielMorsing/following{/other_user}","gists_url":"https://api.github.com/users/DanielMorsing/gists{/gist_id}","starred_url":"https://api.github.com/users/DanielMorsing/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/DanielMorsing/subscriptions","organizations_url":"https://api.github.com/users/DanielMorsing/orgs","repos_url":"https://api.github.com/users/DanielMorsing/repos","events_url":"https://api.github.com/users/DanielMorsing/events{/privacy}","received_events_url":"https://api.github.com/users/DanielMorsing/received_events","type":"User","site_admin":false},"created_at":"2015-04-19T14:18:31Z","updated_at":"2015-04-19T14:18:31Z","body":"How is this race possible? We only write to alive unsynchronized when we have no body and we only install the function that is racing with that write when we do have a body."}}