[
https://issues.apache.org/jira/browse/ZOOKEEPER-1214?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13571756#comment-13571756
]
Michi Mutsuzaki commented on ZOOKEEPER-1214:
--------------------------------------------
I saw this error in 3.4.5 with ZOOKEEPER-1214.patch applied.
2013-02-04 03:42:39,682 503835 [pool-1-thread-6] INFO
org.apache.zookeeper.jmx.MBeanRegistry - Unregister MBean
[org.apache.ZooKeeperService:name0=ReplicatedServer_id0,name1=replica.0,name2=Follower,name3=Connections,name4=127.0.0.1,name5=0x13ca4fc35c40001]
2013-02-04 03:42:39,683 503836 [QuorumPeer[myid=0]/127.0.0.1:2901] ERROR
org.apache.zookeeper.jmx.MBeanRegistry - Unexpected exception during
unregister of [Follower]. It should be reviewed and fixed.
java.lang.IllegalMonitorStateException
at
java.util.concurrent.locks.ReentrantReadWriteLock$Sync.tryReleaseShared(ReentrantReadWriteLock.java:398)
at
java.util.concurrent.locks.AbstractQueuedSynchronizer.releaseShared(AbstractQueuedSynchronizer.java:1340)
at
java.util.concurrent.locks.ReentrantReadWriteLock$ReadLock.unlock(ReentrantReadWriteLock.java:778)
at com.sun.jmx.mbeanserver.Repository.retrieve(Repository.java:522)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.getMBean(DefaultMBeanServerInterceptor.java:1111)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.exclusiveUnregisterMBean(DefaultMBeanServerInterceptor.java:433)
at
com.sun.jmx.interceptor.DefaultMBeanServerInterceptor.unregisterMBean(DefaultMBeanServerInterceptor.java:421)
at
com.sun.jmx.mbeanserver.JmxMBeanServer.unregisterMBean(JmxMBeanServer.java:540)
at
org.apache.zookeeper.jmx.MBeanRegistry.unregister(MBeanRegistry.java:116)
at
org.apache.zookeeper.jmx.MBeanRegistry.unregister(MBeanRegistry.java:137)
at
org.apache.zookeeper.server.quorum.LearnerZooKeeperServer.unregisterJMX(LearnerZooKeeperServer.java:138)
at
org.apache.zookeeper.server.quorum.Follower.followLeader(Follower.java:100)
at
org.apache.zookeeper.server.quorum.QuorumPeer.run(QuorumPeer.java:745)
I'm using openjdk-6-jre-6b24-1.11.3-1ubuntu0.12.04.1. Should I use
sun-java6-jre instead?
--Michi
> QuorumPeer should unregister only its previsously registered MBeans instead
> of use MBeanRegistry.unregisterAll() method.
> ------------------------------------------------------------------------------------------------------------------------
>
> Key: ZOOKEEPER-1214
> URL: https://issues.apache.org/jira/browse/ZOOKEEPER-1214
> Project: ZooKeeper
> Issue Type: Bug
> Components: quorum
> Reporter: César Álvarez Núñez
> Assignee: César Álvarez Núñez
> Fix For: 3.5.0
>
> Attachments: ZOOKEEPER-1214.patch, ZOOKEEPER-1214.patch,
> ZOOKEEPER-1214.patch
>
>
> When a QuorumPeer thread dies, it is unregistering *all* ZKMBeanInfo MBeans
> previously registered on its java process; including those that has not been
> registered by itself.
> It does not cause any side effect in production environment where each server
> is running on a separate java process; but fails when using
> "org.apache.zookeeper.test.QuorumUtil" to programmatically start up a
> zookeeper server ensemble and use its provided methods to force Disconnected,
> SyncConnected or SessionExpired events; in order to perform some
> basic/functional testing.
> Scenario:
> * QuorumUtil qU = new QuorumUtil(1); // It creates a 3 servers ensemble.
> * qU.startAll(); // Startup all servers: 1 Leader + 2 Followers
> * qU.shutdown\(i\); // i is a number from 1 to 3. It shutdown one server.
> The last method causes that a QuorumPeer will die, invoking the
> MBeanRegistry.unregisterAll() method.
> As a result, *all* ZKMBeanInfo MBeans are unregistered; including those
> belonging to the other QuorumPeer instances.
> When trying to restart previous server (qU.restart\(i\)) an AssertionError is
> thrown at MBeanRegistry.register(ZKMBeanInfo bean, ZKMBeanInfo parent)
> method, causing the QuorumPeer thread dead.
> To solve it:
> * MBeanRegistry.unregisterAll() method has been removed.
> * QuorumPeer only unregister its ZKMBeanInfo MBeans.
--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira