Review Board 1.7.22


ZOOKEEPER-1174 Proposed fix to file descriptor leak

Review Request #1766 - Created Sept. 8, 2011 and updated

Ted Dunning
Reviewers
zookeeper
zookeeper-git
When connect throws an exception, we can leak descriptors.
See test program and description on https://issues.apache.org/jira/browse/ZOOKEEPER-1174
src/java/main/org/apache/zookeeper/ClientCnxn.java
Revision 9ea59ca New Change
[20] 999 lines
[+20] [+] public void run() {
1000
                        to = Math.min(to, pingRwTimeout - idlePingRwServer);
1000
                        to = Math.min(to, pingRwTimeout - idlePingRwServer);
1001
                    }
1001
                    }
1002

    
   
1002

   
1003
                    clientCnxnSocket.doTransport(to, pendingQueue, outgoingQueue);
1003
                    clientCnxnSocket.doTransport(to, pendingQueue, outgoingQueue);
1004

    
   
1004

   
1005
                } catch (Exception e) {
1005
                } catch (Throwable e) {
1006
                    if (closing) {
1006
                    if (closing) {
1007
                        if (LOG.isDebugEnabled()) {
1007
                        if (LOG.isDebugEnabled()) {
1008
                            // closing so this is expected
1008
                            // closing so this is expected
1009
                            LOG.debug("An exception was thrown while closing send thread for session 0x"
1009
                            LOG.debug("An exception was thrown while closing send thread for session 0x"
1010
                                    + Long.toHexString(getSessionId())
1010
                                    + Long.toHexString(getSessionId())
[+20] [20] 259 lines
src/java/main/org/apache/zookeeper/ClientCnxnSocketNIO.java
Diff Revision 1 Diff Revision 2
 
src/java/main/org/apache/zookeeper/server/DataTree.java
Diff Revision 1 Diff Revision 2
 
  1. src/java/main/org/apache/zookeeper/ClientCnxn.java: Loading...
  2. src/java/main/org/apache/zookeeper/ClientCnxnSocketNIO.java: Loading...
  3. src/java/main/org/apache/zookeeper/server/DataTree.java: Loading...