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

addWatch api should check the null watch

    XMLWordPrintableJSON

Details

    Description

      public void addWatch(String basePath, Watcher watcher, AddWatchMode mode)
              throws KeeperException, InterruptedException {
          PathUtils.validatePath(basePath);
          String serverPath = prependChroot(basePath);
      
          RequestHeader h = new RequestHeader();
          h.setType(ZooDefs.OpCode.addWatch);
          AddWatchRequest request = new AddWatchRequest(serverPath, mode.getMode());
          ReplyHeader r = cnxn.submitRequest(h, request, new ErrorResponse(),
          
      

      we need to validateWatcher(watcher) to ** avoid the case:

      zk.addWatch("/a/b", null, PERSISTENT_RECURSIVE);
      

      Attachments

        Activity

          People

            ztzg Damien Diederen
            maoling Ling Mao
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 2h 10m
                2h 10m