{"action":"closed","issue":{"url":"https://api.github.com/repos/jinzhu/gorm/issues/667","labels_url":"https://api.github.com/repos/jinzhu/gorm/issues/667/labels{/name}","comments_url":"https://api.github.com/repos/jinzhu/gorm/issues/667/comments","events_url":"https://api.github.com/repos/jinzhu/gorm/issues/667/events","html_url":"https://github.com/jinzhu/gorm/issues/667","id":107886092,"number":667,"title":"Race condition","user":{"login":"nkovacs","id":2269242,"avatar_url":"https://avatars.githubusercontent.com/u/2269242?v=3","gravatar_id":"","url":"https://api.github.com/users/nkovacs","html_url":"https://github.com/nkovacs","followers_url":"https://api.github.com/users/nkovacs/followers","following_url":"https://api.github.com/users/nkovacs/following{/other_user}","gists_url":"https://api.github.com/users/nkovacs/gists{/gist_id}","starred_url":"https://api.github.com/users/nkovacs/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nkovacs/subscriptions","organizations_url":"https://api.github.com/users/nkovacs/orgs","repos_url":"https://api.github.com/users/nkovacs/repos","events_url":"https://api.github.com/users/nkovacs/events{/privacy}","received_events_url":"https://api.github.com/users/nkovacs/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jinzhu/gorm/labels/bug","name":"bug","color":"fc2929"}],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-09-23T10:01:47Z","updated_at":"2015-09-30T23:09:39Z","closed_at":"2015-09-30T23:09:38Z","body":"This is possibly the cause of #547 \r\n\r\n```\r\nWARNING: DATA RACE\r\nRead by goroutine 7:\r\n  runtime.mapaccess2()\r\n      /tmp/workdir/go/src/runtime/hashmap.go:320 +0x0\r\n  github.com/jinzhu/gorm.(*Scope).GetModelStruct()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/model_struct.go:94 +0x2f5\r\n  github.com/jinzhu/gorm.(*Scope).PrimaryFields()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/scope.go:123 +0x99\r\n  github.com/jinzhu/gorm.(*Scope).GetModelStruct.func1()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/model_struct.go:261 +0x29ca\r\n\r\nPrevious write by main goroutine:\r\n  runtime.mapassign1()\r\n      /tmp/workdir/go/src/runtime/hashmap.go:411 +0x0\r\n  github.com/jinzhu/gorm.(*Scope).GetModelStruct()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/model_struct.go:372 +0x1037\r\n  github.com/jinzhu/gorm.(*Scope).TableName()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/scope.go:282 +0x2f6\r\n  github.com/jinzhu/gorm.(*Scope).QuotedTableName()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/scope.go:292 +0x1eb\r\n  github.com/jinzhu/gorm.(*Scope).prepareQuerySql()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/scope_private.go:300 +0x342\r\n  github.com/jinzhu/gorm.Query()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/callback_query.go:44 +0x979\r\n  github.com/jinzhu/gorm.(*Scope).callCallbacks()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/scope_private.go:314 +0x95\r\n  github.com/jinzhu/gorm.(*DB).Find()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/main.go:215 +0x10f\r\n  main.main()\r\n      /home/nkovacs/progs/go/src/gormtest/main.go:113 +0x360\r\n\r\nGoroutine 7 (running) created at:\r\n  github.com/jinzhu/gorm.(*Scope).GetModelStruct()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/model_struct.go:370 +0xfc1\r\n  github.com/jinzhu/gorm.(*Scope).TableName()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/scope.go:282 +0x2f6\r\n  github.com/jinzhu/gorm.(*Scope).QuotedTableName()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/scope.go:292 +0x1eb\r\n  github.com/jinzhu/gorm.(*Scope).prepareQuerySql()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/scope_private.go:300 +0x342\r\n  github.com/jinzhu/gorm.Query()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/callback_query.go:44 +0x979\r\n  github.com/jinzhu/gorm.(*Scope).callCallbacks()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/scope_private.go:314 +0x95\r\n  github.com/jinzhu/gorm.(*DB).Find()\r\n      /home/nkovacs/progs/go/src/github.com/jinzhu/gorm/main.go:215 +0x10f\r\n  main.main()\r\n      /home/nkovacs/progs/go/src/gormtest/main.go:113 +0x360\r\n==================\r\n```"}}