Gian Reto created ZOOKEEPER-4686:
------------------------------------
Summary: ServerMetrics give out invalid values when two server run
in one JVM
Key: ZOOKEEPER-4686
URL: https://issues.apache.org/jira/browse/ZOOKEEPER-4686
Project: ZooKeeper
Issue Type: Bug
Components: metric system, server
Affects Versions: 3.8.0
Reporter: Gian Reto
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?
--
This message was sent by Atlassian Jira
(v8.20.10#820010)