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

Server logs error on shutdown

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Open
    • Major
    • Resolution: Unresolved
    • 3.4.10, 3.4.11
    • None
    • server
    • None

    Description

      Commit d497aac4 introduced the ZooKeeperServer#registerServerShutdownHandler method and corresponding ZooKeeperServerShutdownHandler class.  Both the method and class are package-protected, resulting in the expectation that non-ZK code should not use either.

      However, if registerServerShutdownHandler is not called, then ZK will log an error:

      ZKShutdownHandler is not registered, so ZooKeeper server won't take any action on ERROR or SHUTDOWN server state changes

      There are several problems here.  In order of importance (for me, at least!)

      First, (most important) this certainly should not be logged as an error.  Depending on usage, there may be no need for a shutdown handler.  Always logging an error (with no opportunity to silence it) is therefore wrong.

      Second, the ability to learn of state changes may be of general interest (monitoring, etc); however, this is not possible if the method is protected.

      Third, the method accepts a concrete class that is designed to use a CountDownLatch. This is not appropriate in all cases.  The method should be updated to accept an interface.

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              paulmillar Paul Millar
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

                Created:
                Updated: