Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ZOOKEEPER-2743: Netty connection leaks JMX connection bean.
See https://issues.apache.org/jira/browse/ZOOKEEPER-2743 for details on the symptom and diagnostic. There are many ways of fixing this. For example we can enforce certain ordering of the close operations to eliminate the race condition however that would incur non trivial performance penalty as a result of synchronization. I think the solution in this patch is simple and effective as it observes that the bean unregister call is idempotent and the call itself is trivial so we just always unregister connection upon close the connection, to ensure the bean is unregistered regardless of the races. I've also stress tested this solution on internal Jenkins which indicates no failures of https://issues.apache.org/jira/browse/ZOOKEEPER-2707 for the past two days. A side note is NIO connection in theory would suffer the same problem however I am unable to reproduce the same racing with existing unit test. So I just leave NIO as it is, for now. Author: Michael Han <hanm@apache.org> Reviewers: Rakesh Radhakrishnan <rakeshr@apache.org> Closes #211 from hanm/ZOOKEEPER-2743
- Loading branch information