{"action":"created","issue":{"url":"https://api.github.com/repos/netty/netty/issues/5489","repository_url":"https://api.github.com/repos/netty/netty","labels_url":"https://api.github.com/repos/netty/netty/issues/5489/labels{/name}","comments_url":"https://api.github.com/repos/netty/netty/issues/5489/comments","events_url":"https://api.github.com/repos/netty/netty/issues/5489/events","html_url":"https://github.com/netty/netty/issues/5489","id":163514237,"number":5489,"title":"Race in Netty's DefaultPromise","user":{"login":"buchgr","id":1388179,"avatar_url":"https://avatars.githubusercontent.com/u/1388179?v=3","gravatar_id":"","url":"https://api.github.com/users/buchgr","html_url":"https://github.com/buchgr","followers_url":"https://api.github.com/users/buchgr/followers","following_url":"https://api.github.com/users/buchgr/following{/other_user}","gists_url":"https://api.github.com/users/buchgr/gists{/gist_id}","starred_url":"https://api.github.com/users/buchgr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buchgr/subscriptions","organizations_url":"https://api.github.com/users/buchgr/orgs","repos_url":"https://api.github.com/users/buchgr/repos","events_url":"https://api.github.com/users/buchgr/events{/privacy}","received_events_url":"https://api.github.com/users/buchgr/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":8,"created_at":"2016-07-02T11:22:22Z","updated_at":"2016-07-04T15:51:48Z","closed_at":null,"body":"As reported on the grpc issue tracker https://github.com/grpc/grpc-java/issues/2015\r\n\r\nThere seems to be a race between `DefaultPromise.trySuccess()` and `DefaultPromise.addListener(...)`. It looks like the offending line is [`if (listeners == null)` ](https://github.com/netty/netty/blob/4.1/common/src/main/java/io/netty/util/concurrent/DefaultPromise.java#L421).\r\n\r\nNow, `listeners` is written in a `synchronized` block and read outside of it. Reasoning about about visiblity guarantees and ordering seems complicated. I think it's probably more complex than that comment one line above. We should probably make `listeners` volatile.\r\n\r\ncc: @carl-mastrangelo @ejona86 @nmittler @Scottmitch @normanmaurer "},"comment":{"url":"https://api.github.com/repos/netty/netty/issues/comments/230318091","html_url":"https://github.com/netty/netty/issues/5489#issuecomment-230318091","issue_url":"https://api.github.com/repos/netty/netty/issues/5489","id":230318091,"user":{"login":"buchgr","id":1388179,"avatar_url":"https://avatars.githubusercontent.com/u/1388179?v=3","gravatar_id":"","url":"https://api.github.com/users/buchgr","html_url":"https://github.com/buchgr","followers_url":"https://api.github.com/users/buchgr/followers","following_url":"https://api.github.com/users/buchgr/following{/other_user}","gists_url":"https://api.github.com/users/buchgr/gists{/gist_id}","starred_url":"https://api.github.com/users/buchgr/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/buchgr/subscriptions","organizations_url":"https://api.github.com/users/buchgr/orgs","repos_url":"https://api.github.com/users/buchgr/repos","events_url":"https://api.github.com/users/buchgr/events{/privacy}","received_events_url":"https://api.github.com/users/buchgr/received_events","type":"User","site_admin":false},"created_at":"2016-07-04T15:51:48Z","updated_at":"2016-07-04T15:51:48Z","body":"@normanmaurer that should not be a problem as the listeners are all executed in the event loop thread."}}
{"actor":{"display_login":"buchgr"}}