zookeeper-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From CheneySun <...@git.apache.org>
Subject [GitHub] zookeeper pull request #312: ZOOKEEPER-1669: Operations to server will be ti...
Date Fri, 21 Jul 2017 10:13:03 GMT
Github user CheneySun commented on a diff in the pull request:

    https://github.com/apache/zookeeper/pull/312#discussion_r128729244
  
    --- Diff: src/java/main/org/apache/zookeeper/server/NIOServerCnxnFactory.java ---
    @@ -275,20 +307,9 @@ public synchronized void closeSession(long sessionId) {
     
         @SuppressWarnings("unchecked")
         private void closeSessionWithoutWakeup(long sessionId) {
    -        HashSet<NIOServerCnxn> cnxns;
    -        synchronized (this.cnxns) {
    -            cnxns = (HashSet<NIOServerCnxn>)this.cnxns.clone();
    -        }
    -
    -        for (NIOServerCnxn cnxn : cnxns) {
    -            if (cnxn.getSessionId() == sessionId) {
    -                try {
    -                    cnxn.close();
    -                } catch (Exception e) {
    -                    LOG.warn("exception during session close", e);
    -                }
    -                break;
    -            }
    +        NIOServerCnxn cnxn = sessionMap.remove(sessionId);
    +        if (cnxn != null) {
    +            cnxn.close();
    --- End diff --
    
    @eribeiro good catch, I will fix it.


---
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 infrastructure@apache.org or file a JIRA ticket
with INFRA.
---

Mime
View raw message