{"action":"created","issue":{"url":"https://api.github.com/repos/Sirupsen/logrus/issues/364","repository_url":"https://api.github.com/repos/Sirupsen/logrus","labels_url":"https://api.github.com/repos/Sirupsen/logrus/issues/364/labels{/name}","comments_url":"https://api.github.com/repos/Sirupsen/logrus/issues/364/comments","events_url":"https://api.github.com/repos/Sirupsen/logrus/issues/364/events","html_url":"https://github.com/Sirupsen/logrus/issues/364","id":157740026,"number":364,"title":"Concurrent map errors","user":{"login":"tejasmanohar","id":5959235,"avatar_url":"https://avatars.githubusercontent.com/u/5959235?v=3","gravatar_id":"","url":"https://api.github.com/users/tejasmanohar","html_url":"https://github.com/tejasmanohar","followers_url":"https://api.github.com/users/tejasmanohar/followers","following_url":"https://api.github.com/users/tejasmanohar/following{/other_user}","gists_url":"https://api.github.com/users/tejasmanohar/gists{/gist_id}","starred_url":"https://api.github.com/users/tejasmanohar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tejasmanohar/subscriptions","organizations_url":"https://api.github.com/users/tejasmanohar/orgs","repos_url":"https://api.github.com/users/tejasmanohar/repos","events_url":"https://api.github.com/users/tejasmanohar/events{/privacy}","received_events_url":"https://api.github.com/users/tejasmanohar/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-05-31T18:34:59Z","updated_at":"2016-07-21T23:36:02Z","closed_at":null,"body":"I've been running into this error while using logrus, especially with larger log payloads. Not sure if this has the same root cause of #295 or not.\r\n\r\n```\r\nfatal error: concurrent map read and map writeINFO[0035]\r\n​\r\ngoroutine 44 [running]:\r\nruntime.throw(0x92f2a0, 0x21)\r\n  /usr/local/Cellar/go/1.6.2/libexec/src/runtime/panic.go:547 +0x90 fp=0xc82066f7e0 sp=0xc82066f7c8\r\nruntime.mapaccess1_faststr(0x6e6de0, 0xc820149350, 0x888940, 0xa, 0xc82066f980)\r\n  /usr/local/Cellar/go/1.6.2/libexec/src/runtime/hashmap_fast.go:202 +0x5b fp=0xc82066f840 sp=0xc82066f7e0\r\ngithub.com/Sirupsen/logrus.(*TextFormatter).printColored(0xc82011cac0, 0xc8204abc70, 0xc82041bcc0, 0xc820896c80, 0x5, 0x5, 0x910460, 0x19)\r\n  .../Godeps/_workspace/src/github.com/Sirupsen/logrus/text_formatter.go:120 +0x439 fp=0xc82066fa38 sp=0xc82066f840\r\ngithub.com/Sirupsen/logrus.(*TextFormatter).Format(0xc82011cac0, 0xc82041bcc0, 0x0, 0x0, 0x0, 0x0, 0x0)\r\n  .../Godeps/_workspace/src/github.com/Sirupsen/logrus/text_formatter.go:81 +0x566 fp=0xc82066fbd8 sp=0xc82066fa38\r\ngithub.com/Sirupsen/logrus.(*Entry).Reader(0xc82041bcc0, 0xc81c54f402, 0x0, 0x0)\r\n  .../Godeps/_workspace/src/github.com/Sirupsen/logrus/entry.go:44 +0x67 fp=0xc82066fc70 sp=0xc82066fbd8\r\ngithub.com/Sirupsen/logrus.Entry.log(0xc820131400, 0xc820149350, 0x0, 0x0, 0x0, 0x0, 0x0, 0x0, 0x22102, 0xc8208c2ea0, ...)\r\n  .../Godeps/_workspace/src/github.com/Sirupsen/logrus/entry.go:94 +0x296 fp=0xc82066fd98 sp=0xc82066fc70\r\ngithub.com/Sirupsen/logrus.(*Entry).Error(0xc820119440, 0xc82066fea0, 0x1, 0x1)\r\n  .../Godeps/_workspace/src/github.com/Sirupsen/logrus/entry.go:145 +0x8c fp=0xc82066fe08 sp=0xc82066fd98\r\nmain.(*Source).Run.func1(0xf50470, 0xc820120178, 0xc820119440, 0xc82011d740)\r\n```"},"comment":{"url":"https://api.github.com/repos/Sirupsen/logrus/issues/comments/234415628","html_url":"https://github.com/Sirupsen/logrus/issues/364#issuecomment-234415628","issue_url":"https://api.github.com/repos/Sirupsen/logrus/issues/364","id":234415628,"user":{"login":"tejasmanohar","id":5959235,"avatar_url":"https://avatars.githubusercontent.com/u/5959235?v=3","gravatar_id":"","url":"https://api.github.com/users/tejasmanohar","html_url":"https://github.com/tejasmanohar","followers_url":"https://api.github.com/users/tejasmanohar/followers","following_url":"https://api.github.com/users/tejasmanohar/following{/other_user}","gists_url":"https://api.github.com/users/tejasmanohar/gists{/gist_id}","starred_url":"https://api.github.com/users/tejasmanohar/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tejasmanohar/subscriptions","organizations_url":"https://api.github.com/users/tejasmanohar/orgs","repos_url":"https://api.github.com/users/tejasmanohar/repos","events_url":"https://api.github.com/users/tejasmanohar/events{/privacy}","received_events_url":"https://api.github.com/users/tejasmanohar/received_events","type":"User","site_admin":false},"created_at":"2016-07-21T23:36:02Z","updated_at":"2016-07-21T23:36:02Z","body":"We found the root cause to be when you set a hook that mutates the log payload. Do you have another suggestion on how to do this?\r\n\r\n```\r\npackage log\r\n\r\nimport \"github.com/Sirupsen/logrus\"\r\n\r\ntype infoHook struct {\r\n\tProgram string\r\n\tVersion string\r\n}\r\n\r\nfunc (s *infoHook) Levels() []logrus.Level {\r\n\treturn []logrus.Level{\r\n\t\tlogrus.PanicLevel,\r\n\t\tlogrus.FatalLevel,\r\n\t\tlogrus.ErrorLevel,\r\n\t\tlogrus.WarnLevel,\r\n\t\tlogrus.InfoLevel,\r\n\t\tlogrus.DebugLevel,\r\n\t}\r\n}\r\n\r\nfunc (s *infoHook) Fire(entry *logrus.Entry) error {\r\n\tentry.Data[\"program\"] = s.Program\r\n\tentry.Data[\"version\"] = s.Version\r\n\treturn nil\r\n}\r\n```"}}
{"actor":{"display_login":"tejasmanohar"}}