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

zh->state should not be 0 while handle is active

    XMLWordPrintableJSON

Details

    • Bug
    • Status: In Progress
    • Major
    • Resolution: Unresolved
    • 3.4.6
    • None
    • c client
    • None

    Description

      0 does not correspond to any of the defined states for the zookeeper handle, so a client should not expect to see this value. But in the function handle_error, we set zh->state = 0, which a client may then see. Instead, we should set our state to be ZOO_CONNECTING_STATE.

      At some point the code moved away from 0 as a valid state and introduced the defined states. This broke the fix to ZOOKEEPER-800, which checks if state is 0 to know if the handle has been created but has not yet connected. We now use ZOO_NOTCONNECTED_STATE to mean this, so the check for this in zoo_add_auth must be changed.

      We saw this error in 3.4.6, but I believe it remains present in trunk.

      Attachments

        1. ZOOKEEPER-2519.patch
          3 kB
          Andrew Grasso
        2. ZOOKEEPER-2519.patch
          1 kB
          Andrew Grasso

        Activity

          People

            agrasso Andrew Grasso
            agrasso Andrew Grasso
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated: