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

FD leak when network unreachable

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Critical
    • Resolution: Fixed
    • 3.3.3
    • 3.3.4, 3.4.0, 3.5.0
    • java client
    • None

    Description

      In the socket connection logic there are several errors that result in bad behavior. The basic problem is that a socket is registered with a selector unconditionally when there are nuances that should be dealt with. First, the socket may connect immediately. Secondly, the connect may throw an exception. In either of these two cases, I don't think that the socket should be registered.

      I will attach a test case that demonstrates the problem. I have been unable to create a unit test that exhibits the problem because I would have to mock the low level socket libraries to do so. It would still be good to do so if somebody can figure out a good way.

      Attachments

        1. zk-fd-leak.tgz
          7 kB
          Ted Dunning
        2. ZOOKEEPER-1174.patch
          3 kB
          Ted Dunning
        3. ZOOKEEPER-1174.patch
          6 kB
          Ted Dunning
        4. ZOOKEEPER-1174.patch
          3 kB
          Ted Dunning
        5. ZOOKEEPER-1174.patch
          3 kB
          Ted Dunning
        6. ZOOKEEPER-1174.patch
          1 kB
          Ted Dunning
        7. ZOOKEEPER-1174-3.3.patch
          3 kB
          Camille Fournier
        8. ZOOKEEPER-1174fix.patch
          3 kB
          Camille Fournier

        Issue Links

          Activity

            People

              tdunning Ted Dunning
              tdunning Ted Dunning
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: