{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/16668","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/16668/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/16668/comments","events_url":"https://api.github.com/repos/golang/go/issues/16668/events","html_url":"https://github.com/golang/go/issues/16668","id":170609913,"number":16668,"title":"ctx for <1.7 implementation may not correct ","user":{"login":"lujiajing1126","id":2568208,"avatar_url":"https://avatars.githubusercontent.com/u/2568208?v=3","gravatar_id":"","url":"https://api.github.com/users/lujiajing1126","html_url":"https://github.com/lujiajing1126","followers_url":"https://api.github.com/users/lujiajing1126/followers","following_url":"https://api.github.com/users/lujiajing1126/following{/other_user}","gists_url":"https://api.github.com/users/lujiajing1126/gists{/gist_id}","starred_url":"https://api.github.com/users/lujiajing1126/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lujiajing1126/subscriptions","organizations_url":"https://api.github.com/users/lujiajing1126/orgs","repos_url":"https://api.github.com/users/lujiajing1126/repos","events_url":"https://api.github.com/users/lujiajing1126/events{/privacy}","received_events_url":"https://api.github.com/users/lujiajing1126/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2016-08-11T10:01:18Z","updated_at":"2016-08-11T15:19:39Z","closed_at":null,"body":"```\r\ngo version go1.6.3 darwin/amd64\r\n\r\nGOARCH=\"amd64\"\r\nGOBIN=\"\"\r\nGOEXE=\"\"\r\nGOHOSTARCH=\"amd64\"\r\nGOHOSTOS=\"darwin\"\r\nGOOS=\"darwin\"\r\nGOPATH=\"/Users/megrez/Code/project/wosai/push/worker\"\r\nGORACE=\"\"\r\nGOROOT=\"/usr/local/Cellar/go/1.6.3/libexec\"\r\nGOTOOLDIR=\"/usr/local/Cellar/go/1.6.3/libexec/pkg/tool/darwin_amd64\"\r\nGO15VENDOREXPERIMENT=\"1\"\r\nCC=\"clang\"\r\nGOGCCFLAGS=\"-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common\"\r\nCXX=\"clang++\"\r\nCGO_ENABLED=\"1\"\r\n```\r\n\r\nI dont think the ctx implementation in go 1.6 is semantically correct `https://github.com/golang/net/blob/master/context/ctxhttp/ctxhttp_pre17.go`\r\n\r\nIt simply start a goroutine to do the request and discard response\r\n\r\nIt will send request first and the peer will receive the request and make response, which will make some mistake in some specific situations\r\n\r\nLike a MQ server will consider A client has been received message so that the message cannot be consumed by B client who should have received this message.\r\n\r\nconsider following flow:\r\n\r\n1. cancel `A` client, but the request `R` is under flying, for `R` is a blocking request\r\n2. start client `B` and send a message `M`\r\n3. `A` client may have chance to receive the message `M` for we cannot determine who will receive the message, so i have to wait all `A`'s requests fail then start B which may a waste of time\r\n"},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/239193921","html_url":"https://github.com/golang/go/issues/16668#issuecomment-239193921","issue_url":"https://api.github.com/repos/golang/go/issues/16668","id":239193921,"user":{"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},"created_at":"2016-08-11T15:19:39Z","updated_at":"2016-08-11T15:19:39Z","body":"I'm not sure I understand your scenario. The ctxhttp has a bunch of tests, though. Perhaps you can write a test which demonstrates how it's wrong? Or explain it in pseudo-code?\r\n\r\n/cc @broady @okdave "}}
{"actor":{"display_login":"bradfitz"}}