anmolnar commented on a change in pull request #753: ZOOKEEPER-3204: Reconfig
tests are constantly failing on 3.5 after applying Java 11 fix
URL: https://github.com/apache/zookeeper/pull/753#discussion_r253894010
##########
File path:
zookeeper-server/src/main/java/org/apache/zookeeper/server/NettyServerCnxn.java
##########
@@ -89,41 +86,43 @@ public void close() {
closingChannel = true;
if (LOG.isDebugEnabled()) {
- LOG.debug("close called for sessionid:0x"
- + Long.toHexString(sessionId));
+ 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);
- synchronized(factory.cnxns){
- // if this is not in cnxns then it's already closed
- if (!factory.cnxns.remove(this)) {
- if (LOG.isDebugEnabled()) {
- LOG.debug("cnxns size:" + factory.cnxns.size());
- }
- return;
- }
+ // if this is not in cnxns then it's already closed
+ if (!factory.cnxns.remove(this)) {
if (LOG.isDebugEnabled()) {
- LOG.debug("close in progress for sessionid:0x"
- + Long.toHexString(sessionId));
- }
-
- synchronized (factory.ipMap) {
- Set<NettyServerCnxn> s =
- factory.ipMap.get(((InetSocketAddress)channel
- .getRemoteAddress()).getAddress());
- s.remove(this);
+ LOG.debug("cnxns size:{}", factory.cnxns.size());
}
+ return;
+ }
+ if (LOG.isDebugEnabled()) {
+ LOG.debug("close in progress for sessionid:0x{}",
+ Long.toHexString(sessionId));
}
+ factory.removeCnxnFromIpMap(
+ this,
+ ((InetSocketAddress)channel.remoteAddress()).getAddress());
+
Review comment:
That's part of a different patch. @lvfangmin added it with
https://github.com/apache/zookeeper/commit/95557a30edbdfdf4479a1cb142e0d82a4ba6061d
Because we decided not to backport that patch, I haven't added it.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
With regards,
Apache Git Services