Uploaded image for project: 'ZooKeeper'
  1. ZooKeeper
  2. ZOOKEEPER-1620

NIOServerCnxnFactory (new code introduced in ZK-1504) opens selectors but never closes them

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.5.0
    • 3.5.0
    • server
    • None
    • Reviewed

    Description

      New code (committed in ZK-1504) opens selectors but doesn't close them.
      Specifically AbstractSelectThread in its constructor does

      this.selector = Selector.open();

      But possibly also elsewhere. Tests fail for me with the following message:

      java.io.IOException: Too many open files
      at sun.nio.ch.EPollArrayWrapper.epollCreate(Native Method)
      at sun.nio.ch.EPollArrayWrapper.<init>(EPollArrayWrapper.java:69)
      at sun.nio.ch.EPollSelectorImpl.<init>(EPollSelectorImpl.java:52)
      at sun.nio.ch.EPollSelectorProvider.openSelector(EPollSelectorProvider.java:18)
      at java.nio.channels.Selector.open(Selector.java:209)
      at org.apache.zookeeper.server.NIOServerCnxnFactory$AbstractSelectThread.<init>(NIOServerCnxnFactory.java:128)
      at org.apache.zookeeper.server.NIOServerCnxnFactory$AcceptThread.<init>(NIOServerCnxnFactory.java:177)
      at org.apache.zookeeper.server.NIOServerCnxnFactory.configure(NIOServerCnxnFactory.java:663)
      at org.apache.zookeeper.server.ServerCnxnFactory.createFactory(ServerCnxnFactory.java:127)
      at org.apache.zookeeper.server.quorum.QuorumPeer.<init>(QuorumPeer.java:709)
      at org.apache.zookeeper.test.QuorumBase.startServers(QuorumBase.java:177)
      at org.apache.zookeeper.test.QuorumBase.setUp(QuorumBase.java:113)
      at org.apache.zookeeper.test.QuorumBase.setUp(QuorumBase.java:71)
      at org.apache.zookeeper.test.ReconfigTest.setUp(ReconfigTest.java:56)

      Attachments

        1. ZOOKEEPER-1620.patch
          4 kB
          Thawan Kooburat
        2. ZOOKEEPER-1620.patch
          4 kB
          Thawan Kooburat

        Issue Links

          Activity

            People

              thawan Thawan Kooburat
              shralex Alexander Shraer
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: