[
https://issues.apache.org/jira/browse/ZOOKEEPER-2239?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Kevin Lee updated ZOOKEEPER-2239:
---------------------------------
Description: The "State" property of LocalPeerBean in package
org.apache.zookeeper.server.quorum is returning the incorrect value. It is
performing peer.getState() which is calling the getState() method on
java.lang.Thread instead of getting the server state from
org.apache.zookeeper.server.quorum.QuorumPeer. The Javadoc within
LocalPeerMXBean.java states that it should be returning the server state as
well. The fix is to call peer.getServerState() in the getState() method of
LocalPeerBean instead of peer.getState().toString(). This will return the
states defined in QuorumStats.Provider (unknown, leaderelection, leading,
following, and observing). This issue prevents JMX monitoring of the Zookeeper
server state. (was: The "State" property of LocalPeerBean in package
org.apache.zookeeper.server.quorum is returning the incorrect value. It is
performing peer.getState() which is calling the getState() method on
java.lang.Thread instead of getting the server state from
org.apache.zookeeper.server.quorum.QuorumPeer. The Javadoc within
LocalPeerMXBean.java states that it should be returning the server state as
well. The fix is to call peer.getServerState() in the getState() method of
LocalPeerBean instead of peer.getState().toString(). This will return the
states defined in QuorumStats.Provider (unknown, leaderelection, leading,
following, and observing).)
> JMX State from LocalPeerBean Incorrect
> --------------------------------------
>
> Key: ZOOKEEPER-2239
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-2239
> Project: ZooKeeper
> Issue Type: Bug
> Components: jmx
> Affects Versions: 3.4.6
> Environment: All
> Reporter: Kevin Lee
>
> The "State" property of LocalPeerBean in package
> org.apache.zookeeper.server.quorum is returning the incorrect value. It is
> performing peer.getState() which is calling the getState() method on
> java.lang.Thread instead of getting the server state from
> org.apache.zookeeper.server.quorum.QuorumPeer. The Javadoc within
> LocalPeerMXBean.java states that it should be returning the server state as
> well. The fix is to call peer.getServerState() in the getState() method of
> LocalPeerBean instead of peer.getState().toString(). This will return the
> states defined in QuorumStats.Provider (unknown, leaderelection, leading,
> following, and observing). This issue prevents JMX monitoring of the
> Zookeeper server state.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)