{"action":"opened","issue":{"url":"https://api.github.com/repos/google/trillian/issues/1863","repository_url":"https://api.github.com/repos/google/trillian","labels_url":"https://api.github.com/repos/google/trillian/issues/1863/labels{/name}","comments_url":"https://api.github.com/repos/google/trillian/issues/1863/comments","events_url":"https://api.github.com/repos/google/trillian/issues/1863/events","html_url":"https://github.com/google/trillian/issues/1863","id":497804388,"node_id":"MDU6SXNzdWU0OTc4MDQzODg=","number":1863,"title":"Data race between flagsaver and OperationManager","user":{"login":"mhutchinson","id":1355668,"node_id":"MDQ6VXNlcjEzNTU2Njg=","avatar_url":"https://avatars1.githubusercontent.com/u/1355668?v=4","gravatar_id":"","url":"https://api.github.com/users/mhutchinson","html_url":"https://github.com/mhutchinson","followers_url":"https://api.github.com/users/mhutchinson/followers","following_url":"https://api.github.com/users/mhutchinson/following{/other_user}","gists_url":"https://api.github.com/users/mhutchinson/gists{/gist_id}","starred_url":"https://api.github.com/users/mhutchinson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mhutchinson/subscriptions","organizations_url":"https://api.github.com/users/mhutchinson/orgs","repos_url":"https://api.github.com/users/mhutchinson/repos","events_url":"https://api.github.com/users/mhutchinson/events{/privacy}","received_events_url":"https://api.github.com/users/mhutchinson/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2019-09-24T16:45:46Z","updated_at":"2019-09-24T16:45:46Z","closed_at":null,"author_association":"COLLABORATOR","body":"From a cursory glance it looks like this is test-only code. Manifested on 2/5 runs. Was first detected in Travis when I was modifying the config which caused more tests to be covered by race than normal (https://travis-ci.org/google/trillian/jobs/589040627).\r\n\r\nTo repro:\r\n```go test -count 5 -race -run TestNewClientDialOptionsFromFlagsWithTLSCertFileSet ./client/rpcflags```\r\n\r\nResult:\r\n```\r\nWARNING: DATA RACE\r\nWrite at 0x000001dc2640 by goroutine 123:\r\n  flag.(*boolValue).Set()\r\n      /usr/lib/google-golang/src/flag/flag.go:121 +0x7f\r\n  flag.(*FlagSet).Set()\r\n      /usr/lib/google-golang/src/flag/flag.go:426 +0x111\r\n  github.com/google/trillian/testonly/flagsaver.(*Stash).Restore()\r\n      /usr/lib/google-golang/src/flag/flag.go:439 +0x158\r\n  github.com/google/trillian/testonly/flagsaver.(*Stash).MustRestore()\r\n      /usr/local/google/home/mhutchinson/gitclients/trillian/testonly/flagsaver/flagsaver.go:69 +0x3f\r\n  github.com/google/trillian/client/rpcflags.TestNewClientDialOptionsFromFlagsWithTLSCertFileSet()\r\n      /usr/local/google/home/mhutchinson/gitclients/trillian/client/rpcflags/rpcflags_test.go:135 +0xa7d\r\n  testing.tRunner()\r\n      /usr/lib/google-golang/src/testing/testing.go:909 +0x199\r\n\r\nPrevious read at 0x000001dc2640 by goroutine 134:\r\n  github.com/golang/glog.(*loggingT).output()\r\n      /usr/local/google/home/mhutchinson/go/pkg/mod/github.com/golang/glog@v0.0.0-20160126235308-23def4e6c14b/glog.go:682 +0x17d\r\n  github.com/golang/glog.(*loggingT).printDepth()\r\n      /usr/local/google/home/mhutchinson/go/pkg/mod/github.com/golang/glog@v0.0.0-20160126235308-23def4e6c14b/glog.go:646 +0x22e\r\n  github.com/google/trillian/log.(*logOperationExecutor).run()\r\n      /usr/local/google/home/mhutchinson/go/pkg/mod/github.com/golang/glog@v0.0.0-20160126235308-23def4e6c14b/glog.go:637 +0x6b4\r\n  github.com/google/trillian/log.(*OperationManager).getLogsAndExecutePass()\r\n      /usr/local/google/home/mhutchinson/gitclients/trillian/log/operation_manager.go:306 +0x4b2\r\n  github.com/google/trillian/log.(*OperationManager).OperationLoop()\r\n      /usr/local/google/home/mhutchinson/gitclients/trillian/log/operation_manager.go:327 +0x4fe\r\n  github.com/google/trillian/testonly/integration.NewLogEnvWithRegistryAndGRPCOptions.func1()\r\n      /usr/local/google/home/mhutchinson/gitclients/trillian/testonly/integration/logenv.go:148 +0x80\r\n\r\nGoroutine 123 (running) created at:\r\n  testing.(*T).Run()\r\n      /usr/lib/google-golang/src/testing/testing.go:960 +0x651\r\n  testing.runTests.func1()\r\n      /usr/lib/google-golang/src/testing/testing.go:1204 +0xa6\r\n  testing.tRunner()\r\n      /usr/lib/google-golang/src/testing/testing.go:909 +0x199\r\n  testing.runTests()\r\n      /usr/lib/google-golang/src/testing/testing.go:1202 +0x521\r\n  testing.(*M).Run()\r\n      /usr/lib/google-golang/src/testing/testing.go:1119 +0x309\r\n  main.main()\r\n      _testmain.go:48 +0x223\r\n\r\nGoroutine 134 (running) created at:\r\n  github.com/google/trillian/testonly/integration.NewLogEnvWithRegistryAndGRPCOptions()\r\n      /usr/local/google/home/mhutchinson/gitclients/trillian/testonly/integration/logenv.go:146 +0x686\r\n  github.com/google/trillian/testonly/integration.NewLogEnvWithGRPCOptions()\r\n      /usr/local/google/home/mhutchinson/gitclients/trillian/testonly/integration/logenv.go:99 +0x3f8\r\n  github.com/google/trillian/client/rpcflags.TestNewClientDialOptionsFromFlagsWithTLSCertFileSet()\r\n      /usr/local/google/home/mhutchinson/gitclients/trillian/client/rpcflags/rpcflags_test.go:105 +0x550\r\n  testing.tRunner()\r\n      /usr/lib/google-golang/src/testing/testing.go:909 +0x199\r\n==================\r\n--- FAIL: TestNewClientDialOptionsFromFlagsWithTLSCertFileSet (0.58s)\r\n    testing.go:853: race detected during execution of test\r\n```"}}
{"actor":{"display_login":"mhutchinson"}}