{"action":"created","issue":{"url":"https://api.github.com/repos/grpc/grpc-java/issues/2543","repository_url":"https://api.github.com/repos/grpc/grpc-java","labels_url":"https://api.github.com/repos/grpc/grpc-java/issues/2543/labels{/name}","comments_url":"https://api.github.com/repos/grpc/grpc-java/issues/2543/comments","events_url":"https://api.github.com/repos/grpc/grpc-java/issues/2543/events","html_url":"https://github.com/grpc/grpc-java/pull/2543","id":196825958,"number":2543,"title":"context: fix race condition in Context","user":{"login":"carl-mastrangelo","id":8943572,"avatar_url":"https://avatars.githubusercontent.com/u/8943572?v=3","gravatar_id":"","url":"https://api.github.com/users/carl-mastrangelo","html_url":"https://github.com/carl-mastrangelo","followers_url":"https://api.github.com/users/carl-mastrangelo/followers","following_url":"https://api.github.com/users/carl-mastrangelo/following{/other_user}","gists_url":"https://api.github.com/users/carl-mastrangelo/gists{/gist_id}","starred_url":"https://api.github.com/users/carl-mastrangelo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/carl-mastrangelo/subscriptions","organizations_url":"https://api.github.com/users/carl-mastrangelo/orgs","repos_url":"https://api.github.com/users/carl-mastrangelo/repos","events_url":"https://api.github.com/users/carl-mastrangelo/events{/privacy}","received_events_url":"https://api.github.com/users/carl-mastrangelo/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"zhangkun83","id":9053690,"avatar_url":"https://avatars.githubusercontent.com/u/9053690?v=3","gravatar_id":"","url":"https://api.github.com/users/zhangkun83","html_url":"https://github.com/zhangkun83","followers_url":"https://api.github.com/users/zhangkun83/followers","following_url":"https://api.github.com/users/zhangkun83/following{/other_user}","gists_url":"https://api.github.com/users/zhangkun83/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangkun83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangkun83/subscriptions","organizations_url":"https://api.github.com/users/zhangkun83/orgs","repos_url":"https://api.github.com/users/zhangkun83/repos","events_url":"https://api.github.com/users/zhangkun83/events{/privacy}","received_events_url":"https://api.github.com/users/zhangkun83/received_events","type":"User","site_admin":false},"assignees":[{"login":"zhangkun83","id":9053690,"avatar_url":"https://avatars.githubusercontent.com/u/9053690?v=3","gravatar_id":"","url":"https://api.github.com/users/zhangkun83","html_url":"https://github.com/zhangkun83","followers_url":"https://api.github.com/users/zhangkun83/followers","following_url":"https://api.github.com/users/zhangkun83/following{/other_user}","gists_url":"https://api.github.com/users/zhangkun83/gists{/gist_id}","starred_url":"https://api.github.com/users/zhangkun83/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/zhangkun83/subscriptions","organizations_url":"https://api.github.com/users/zhangkun83/orgs","repos_url":"https://api.github.com/users/zhangkun83/repos","events_url":"https://api.github.com/users/zhangkun83/events{/privacy}","received_events_url":"https://api.github.com/users/zhangkun83/received_events","type":"User","site_admin":false}],"milestone":null,"comments":2,"created_at":"2016-12-21T01:48:15Z","updated_at":"2016-12-21T18:40:14Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/grpc/grpc-java/pulls/2543","html_url":"https://github.com/grpc/grpc-java/pull/2543","diff_url":"https://github.com/grpc/grpc-java/pull/2543.diff","patch_url":"https://github.com/grpc/grpc-java/pull/2543.patch"},"body":"As seen here:\r\n\r\n```\r\n  Write of size 8 at 0x7ff22a3359f0 by thread T52 (mutexes: write M938296775443437872):\r\n    #0 io.grpc.Context.initializeStorage()Lio/grpc/Context$Storage; (Context.java:138)  \r\n    #1 io.grpc.Context.storage()Lio/grpc/Context$Storage; (Context.java:145)  \r\n    #2 io.grpc.Context.current()Lio/grpc/Context; (Context.java:174)  \r\n    #3 io.grpc.internal.ClientCallImpl.<init>(Lio/grpc/MethodDescriptor;Ljava/util/concurrent/Executor;Lio/grpc/CallOptions;Lio/grpc/internal/StatsTraceContext;Lio/grpc/internal/ClientCallImpl$ClientTransportProvider;Ljava/util/concurrent/ScheduledExecutorService;)V (ClientCallImpl.java:109)  \r\n    #4 io.grpc.internal.ManagedChannelImpl$RealChannel.newCall(Lio/grpc/MethodDescriptor;Lio/grpc/CallOptions;)Lio/grpc/ClientCall; (ManagedChannelImpl.java:625)  \r\n    #5 io.grpc.internal.ManagedChannelImpl.newCall(Lio/grpc/MethodDescriptor;Lio/grpc/CallOptions;)Lio/grpc/ClientCall; (ManagedChannelImpl.java:592)  \r\n    #6 io.grpc.testing.integration.TestServiceGrpc$TestServiceStub.streamingOutputCall(Lio/grpc/testing/integration/Messages$StreamingOutputCallRequest;Lio/grpc/stub/StreamObserver;)V (TestServiceGrpc.java:315)  \r\n    #7 io.grpc.testing.integration.ConcurrencyTest$ClientWorker.run()V (ConcurrencyTest.java:138)  \r\n    #8 java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V (ThreadPoolExecutor.java:1142)  \r\n    #9 java.util.concurrent.ThreadPoolExecutor$Worker.run()V (ThreadPoolExecutor.java:617)  \r\n    #10 java.lang.Thread.run()V (Thread.java:745)  \r\n    #11 (Generated Stub)  \r\n\r\n  Previous read of size 8 at 0x7ff22a3359f0 by thread T81:\r\n    #0 io.grpc.Context.storage()Lio/grpc/Context$Storage; (Context.java:144)  \r\n    #1 io.grpc.Context.current()Lio/grpc/Context; (Context.java:174)  \r\n    #2 io.grpc.internal.ClientCallImpl.<init>(Lio/grpc/MethodDescriptor;Ljava/util/concurrent/Executor;Lio/grpc/CallOptions;Lio/grpc/internal/StatsTraceContext;Lio/grpc/internal/ClientCallImpl$ClientTransportProvider;Ljava/util/concurrent/ScheduledExecutorService;)V (ClientCallImpl.java:109)  \r\n    #3 io.grpc.internal.ManagedChannelImpl$RealChannel.newCall(Lio/grpc/MethodDescriptor;Lio/grpc/CallOptions;)Lio/grpc/ClientCall; (ManagedChannelImpl.java:625)  \r\n    #4 io.grpc.internal.ManagedChannelImpl.newCall(Lio/grpc/MethodDescriptor;Lio/grpc/CallOptions;)Lio/grpc/ClientCall; (ManagedChannelImpl.java:592)  \r\n    #5 io.grpc.testing.integration.TestServiceGrpc$TestServiceStub.streamingOutputCall(Lio/grpc/testing/integration/Messages$StreamingOutputCallRequest;Lio/grpc/stub/StreamObserver;)V (TestServiceGrpc.java:315)  \r\n    #6 io.grpc.testing.integration.ConcurrencyTest$ClientWorker.run()V (ConcurrencyTest.java:138)  \r\n    #7 java.util.concurrent.ThreadPoolExecutor.runWorker(Ljava/util/concurrent/ThreadPoolExecutor$Worker;)V (ThreadPoolExecutor.java:1142)  \r\n    #8 java.util.concurrent.ThreadPoolExecutor$Worker.run()V (ThreadPoolExecutor.java:617)  \r\n    #9 java.lang.Thread.run()V (Thread.java:745)  \r\n    #10 (Generated Stub)  \r\n\r\n```"},"comment":{"url":"https://api.github.com/repos/grpc/grpc-java/issues/comments/268605140","html_url":"https://github.com/grpc/grpc-java/pull/2543#issuecomment-268605140","issue_url":"https://api.github.com/repos/grpc/grpc-java/issues/2543","id":268605140,"user":{"login":"dapengzhang0","id":4779759,"avatar_url":"https://avatars.githubusercontent.com/u/4779759?v=3","gravatar_id":"","url":"https://api.github.com/users/dapengzhang0","html_url":"https://github.com/dapengzhang0","followers_url":"https://api.github.com/users/dapengzhang0/followers","following_url":"https://api.github.com/users/dapengzhang0/following{/other_user}","gists_url":"https://api.github.com/users/dapengzhang0/gists{/gist_id}","starred_url":"https://api.github.com/users/dapengzhang0/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dapengzhang0/subscriptions","organizations_url":"https://api.github.com/users/dapengzhang0/orgs","repos_url":"https://api.github.com/users/dapengzhang0/repos","events_url":"https://api.github.com/users/dapengzhang0/events{/privacy}","received_events_url":"https://api.github.com/users/dapengzhang0/received_events","type":"User","site_admin":false},"created_at":"2016-12-21T18:40:14Z","updated_at":"2016-12-21T18:40:14Z","body":"add a `@LazyInit` annotation to the `storage` field will pass the tsan detector. \r\nAn alternative (better) solution for lazy init is to use Initialization-on-demand_holder_idiom as in #2539.\r\nIf lazy initialization is not a requirement at all, a static block of eager-init can suffice. "}}
{"actor":{"display_login":"dapengzhang0"}}