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

ServerMetrics give out invalid values when two server run in one JVM



    • Bug
    • Status: Open
    • Minor
    • Resolution: Unresolved
    • 3.8.0
    • None
    • metric system, server
    • None


      In our application we sometimes start two zookeeper servers in a single application process. First, we start one server but depending on what happens on other locations, it happens that we need to start a second server with different configuration and another set of servers in the quorum. The problem we face when we read metrics with our MetricsProvider is, that the startup of the second server causing some metrics to be unregistered (gauges for example) while other published values are just not correct anymore. I was following your discussion (e.g., here https://github.com/apache/zookeeper/pull/840#pullrequestreview-214872675) and know that it was a conscious decision.

      For us the best thing would indeed be, if instead of static call, an instance for every server withing a JVM would be implemented (kind of similar as for clients). Nevertheless, the current situation is that the values that are published are wrong (and I could not find an indication for that). Not only the meters extracted via MetricsProvider but also the 4lw mntr report invalid values.

      Could you offer a bug fix or a way how we could reliably avoid reading garbage values? And my there be other effects when running two server in one JVM?




            Unassigned Unassigned
            s.nug Gian Reto
            0 Vote for this issue
            1 Start watching this issue