zookeeper-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kevin Lee <kgle...@yahoo.com.INVALID>
Subject LocalPeerBean getState() Possibly Incorrect
Date Tue, 04 Aug 2015 15:37:15 GMT

When performing some JMX investigation and looking at the “State” within the LocalPeerBean,
I noticed the state was “Runnable”.  So I downloaded the Zookeeper source code and took
a look at LocalPeerBean.java in org/apache/zookeeper/server/quorum.  It appears that it is
returning “peer.getState().toString()” which I do not believe was the intent here because
peer.getState() is returning the “Thread” state, not the server state as the comment says
it should be in “LocalPeerMXBean.java”.  To get the server state it should be doing a
“peer.getServerState()” which will use the getServerState() method on the QuorumPeer class
from which it is retrieving the state.  So the states would be “following”, “leading”,
etc instead of the Java thread states.

Does anyone know if this a bug that needs to be addressed or if it is working as intended?

View raw message