Github user rakeshadr commented on a diff in the pull request:
https://github.com/apache/zookeeper/pull/211#discussion_r110080170
--- Diff: src/java/main/org/apache/zookeeper/server/NettyServerCnxn.java ---
@@ -87,6 +87,12 @@ public void close() {
LOG.debug("close called for sessionid:0x"
+ Long.toHexString(sessionId));
}
+
+ // ZOOKEEPER-2743:
+ // Always unregister connection upon close to prevent
+ // connection bean leak under certain race conditions.
+ factory.unregisterConnection(this);
--- End diff --
Any chance to occur another race condition, [1] session finalization is in
progress [2] client cnxn closure due to server shutdown. Assume [1] step is in
progress and not yet registered the connection bean [2] step is in progress and
as per this patch unregistered bean irrespective of cnxn exists in factory and
returns. Again assume now, [1] step continues and registering the connection
bean. This is again leaking the cnxn bean, right?
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---