{"action":"created","issue":{"url":"https://api.github.com/repos/golang/go/issues/18137","repository_url":"https://api.github.com/repos/golang/go","labels_url":"https://api.github.com/repos/golang/go/issues/18137/labels{/name}","comments_url":"https://api.github.com/repos/golang/go/issues/18137/comments","events_url":"https://api.github.com/repos/golang/go/issues/18137/events","html_url":"https://github.com/golang/go/issues/18137","id":192855889,"number":18137,"title":"doc: mention concurrent map iteration and map write panic (throw) in release notes","user":{"login":"bmhatfield","id":1119967,"avatar_url":"https://avatars3.githubusercontent.com/u/1119967?v=4","gravatar_id":"","url":"https://api.github.com/users/bmhatfield","html_url":"https://github.com/bmhatfield","followers_url":"https://api.github.com/users/bmhatfield/followers","following_url":"https://api.github.com/users/bmhatfield/following{/other_user}","gists_url":"https://api.github.com/users/bmhatfield/gists{/gist_id}","starred_url":"https://api.github.com/users/bmhatfield/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/bmhatfield/subscriptions","organizations_url":"https://api.github.com/users/bmhatfield/orgs","repos_url":"https://api.github.com/users/bmhatfield/repos","events_url":"https://api.github.com/users/bmhatfield/events{/privacy}","received_events_url":"https://api.github.com/users/bmhatfield/received_events","type":"User","site_admin":false},"labels":[{"id":150880209,"url":"https://api.github.com/repos/golang/go/labels/Documentation","name":"Documentation","color":"aaffaa","default":false},{"id":373399998,"url":"https://api.github.com/repos/golang/go/labels/NeedsFix","name":"NeedsFix","color":"ededed","default":false}],"state":"closed","locked":false,"assignee":{"login":"randall77","id":6889504,"avatar_url":"https://avatars0.githubusercontent.com/u/6889504?v=4","gravatar_id":"","url":"https://api.github.com/users/randall77","html_url":"https://github.com/randall77","followers_url":"https://api.github.com/users/randall77/followers","following_url":"https://api.github.com/users/randall77/following{/other_user}","gists_url":"https://api.github.com/users/randall77/gists{/gist_id}","starred_url":"https://api.github.com/users/randall77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/randall77/subscriptions","organizations_url":"https://api.github.com/users/randall77/orgs","repos_url":"https://api.github.com/users/randall77/repos","events_url":"https://api.github.com/users/randall77/events{/privacy}","received_events_url":"https://api.github.com/users/randall77/received_events","type":"User","site_admin":false},"assignees":[{"login":"randall77","id":6889504,"avatar_url":"https://avatars0.githubusercontent.com/u/6889504?v=4","gravatar_id":"","url":"https://api.github.com/users/randall77","html_url":"https://github.com/randall77","followers_url":"https://api.github.com/users/randall77/followers","following_url":"https://api.github.com/users/randall77/following{/other_user}","gists_url":"https://api.github.com/users/randall77/gists{/gist_id}","starred_url":"https://api.github.com/users/randall77/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/randall77/subscriptions","organizations_url":"https://api.github.com/users/randall77/orgs","repos_url":"https://api.github.com/users/randall77/repos","events_url":"https://api.github.com/users/randall77/events{/privacy}","received_events_url":"https://api.github.com/users/randall77/received_events","type":"User","site_admin":false}],"milestone":{"url":"https://api.github.com/repos/golang/go/milestones/38","html_url":"https://github.com/golang/go/milestone/38","labels_url":"https://api.github.com/repos/golang/go/milestones/38/labels","id":1709363,"number":38,"title":"Go1.8","description":"","creator":{"login":"griesemer","id":8528975,"avatar_url":"https://avatars2.githubusercontent.com/u/8528975?v=4","gravatar_id":"","url":"https://api.github.com/users/griesemer","html_url":"https://github.com/griesemer","followers_url":"https://api.github.com/users/griesemer/followers","following_url":"https://api.github.com/users/griesemer/following{/other_user}","gists_url":"https://api.github.com/users/griesemer/gists{/gist_id}","starred_url":"https://api.github.com/users/griesemer/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/griesemer/subscriptions","organizations_url":"https://api.github.com/users/griesemer/orgs","repos_url":"https://api.github.com/users/griesemer/repos","events_url":"https://api.github.com/users/griesemer/events{/privacy}","received_events_url":"https://api.github.com/users/griesemer/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":755,"state":"closed","created_at":"2016-04-15T16:30:23Z","updated_at":"2017-02-17T16:18:25Z","due_on":"2017-02-16T08:00:00Z","closed_at":"2017-02-17T16:18:25Z"},"comments":7,"created_at":"2016-12-01T14:06:44Z","updated_at":"2017-08-24T23:38:29Z","closed_at":"2016-12-06T22:32:34Z","body":"Please answer these questions before submitting your issue. Thanks!\r\n\r\n### What version of Go are you using (`go version`)?\r\n\r\n1.8beta1\r\n\r\n\r\n### What operating system and processor architecture are you using (`go env`)?\r\n\r\nlinux, amd64\r\n\r\n### What did you do?\r\nI canary'd Go 1.8 on a program that has existed for 3 years, and been run on nearly every version of Go prior to 1.8. Nothing else changed other than switching to Go 1.8.\r\n\r\n\r\n### What did you expect to see?\r\nAll the wonderful goodness in Go 1.8!\r\n\r\n\r\n### What did you see instead?\r\n```\r\nfatal error: concurrent map iteration and map write\r\n\r\ngoroutine 67 [running]:\r\nruntime.throw(0x812ca8, 0x26)\r\n\t/usr/local/go/src/runtime/panic.go:596 +0x95 fp=0xc443d32e18 sp=0xc443d32df8\r\nruntime.mapiternext(0xc443d32f68)\r\n\t/usr/local/go/src/runtime/hashmap.go:737 +0x7ee fp=0xc443d32ec8 sp=0xc443d32e18\r\ngithub.com/crashlytics/gusset/caching-proxy.(*CachingProxy).Start.func1(0xc420012a00)\r\n\t/home/ubuntu/gopath-root/src/github.com/crashlytics/gusset/caching-proxy/caching-proxy.go:179 +0x2fa fp=0xc443d32fd8 sp=0xc443d32ec8\r\nruntime.goexit()\r\n\t/usr/local/go/src/runtime/asm_amd64.s:2184 +0x1 fp=0xc443d32fe0 sp=0xc443d32fd8\r\ncreated by github.com/crashlytics/gusset/caching-proxy.(*CachingProxy).Start\r\n\t/home/ubuntu/gopath-root/src/github.com/crashlytics/gusset/caching-proxy/caching-proxy.go:187 +0x1a3\r\n```\r\n\r\nThe code in question is:\r\n\r\n```go\r\n// A goroutine method to watch the cache size. Runs in the background,\r\n// polling the cache's size and reporting statistics. This is to improve\r\n// performance of cache-fills (where this used to live, synchronously) as\r\n// well as ensure that the cache-size is properly reported even when no\r\n// new requests are making it against the backend.\r\ngo func() {\r\n\tfor true {\r\n\t\ttime.Sleep(20 * time.Second)\r\n\t\tcacheSize := c.Cache.ItemCount()\r\n\t\tprocessing := len(c.processing)\r\n\r\n\t\tif processing > 0 {\r\n\t\t\tfor k, v := range c.processing {\r\n\t\t\t\textralog.Debugf(\"Processing request: %s, with %d waiting for a response\", k, len(v))\r\n\t\t\t}\r\n\t\t}\r\n\t\textralog.Debugf(\"Cache-watcher: Cache Size: %d, Processing: %d\", cacheSize, processing)\r\n\t\textralog.Gauge(\"cachingproxy.cache.size\", cacheSize)\r\n\t\textralog.Gauge(\"cachingproxy.cache.fill.processing\", processing)\r\n\t}\r\n}()\r\n```\r\n\r\nI believe I do see a potential for an unsynchronized map access here, and am going to review this 2-year old code (and other accesses to c.processing) more deeply. However, I am surprised that this is the first time I am seeing this.\r\n\r\nDoes go1.8 include additional concurrency protections or checks that are previously not in earlier versions? If so, it may be worth highlighting that people should re-check old programs for correctness in the release notes."},"comment":{"url":"https://api.github.com/repos/golang/go/issues/comments/324785855","html_url":"https://github.com/golang/go/issues/18137#issuecomment-324785855","issue_url":"https://api.github.com/repos/golang/go/issues/18137","id":324785855,"user":{"login":"deckarep","id":200686,"avatar_url":"https://avatars1.githubusercontent.com/u/200686?v=4","gravatar_id":"","url":"https://api.github.com/users/deckarep","html_url":"https://github.com/deckarep","followers_url":"https://api.github.com/users/deckarep/followers","following_url":"https://api.github.com/users/deckarep/following{/other_user}","gists_url":"https://api.github.com/users/deckarep/gists{/gist_id}","starred_url":"https://api.github.com/users/deckarep/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/deckarep/subscriptions","organizations_url":"https://api.github.com/users/deckarep/orgs","repos_url":"https://api.github.com/users/deckarep/repos","events_url":"https://api.github.com/users/deckarep/events{/privacy}","received_events_url":"https://api.github.com/users/deckarep/received_events","type":"User","site_admin":false},"created_at":"2017-08-24T23:38:29Z","updated_at":"2017-08-24T23:38:29Z","body":"Hey @davecheney and @bradfitz -- i know this feature was added back to Go's runtime quite a while ago...but I'm just wondering how the decision was made to panic applications when this case is hit rather than let it run and log?  For the record I typically agree that you never want such behavior in prod but it also seems like a pretty big deal to just crash in production scenarios?  Any thread on this you can point me to?  Thanks again!"}}
{"actor":{"display_login":"deckarep"}}