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

C client invokes watcher callbacks multiple times

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Critical
    • Resolution: Not A Problem
    • 3.3.1
    • None
    • c client
    • None
    • Mac OS X 10.6.5

    Description

      Code using the C client assumes that watcher callbacks are called exactly once. If the watcher is called more than once, the process will likely overwrite freed memory and/or crash.

      collect_session_watchers (zk_hashtable.c) gathers watchers from active_node_watchers, active_exist_watchers, and active_child_watchers without removing them. This results in watchers being invoked more than once.

      Test code is attached that reproduces the bug, along with a proposed patch.

      Attachments

        1. watcher_twice.c
          1 kB
          Austin Bennett
        2. ZOOKEEPER-890.patch
          0.6 kB
          Austin Bennett

        Issue Links

          Activity

            People

              Unassigned Unassigned
              austin Austin Bennett
              Votes:
              0 Vote for this issue
              Watchers:
              0 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: