curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Corey Nolet <cjno...@gmail.com>
Subject LeaderSelector throwing exception on mutex.acquire()
Date Sat, 21 Jun 2014 02:14:08 GMT
The exception below is happening quite frequently in my code. It looks like
it's because I'm trying to do operations with a client before it has fully
initiated a connection to Zookeeper. What is the recommended way to wait
until the curatorFramework is connected? Apply a connectionListener and
block until a state of CONNECTED is passed into the listener?


Thanks!

2014-06-20 22:10:08,335 [leader.LeaderSelector] ERROR: mutex.acquire()
threw an exception

java.lang.IllegalStateException: instance must be started before calling
this method

at com.google.common.base.Preconditions.checkState(Preconditions.java:149)

at
org.apache.curator.framework.imps.CuratorFrameworkImpl.delete(CuratorFrameworkImpl.java:358)

at
org.apache.curator.framework.recipes.locks.LockInternals.deleteOurPath(LockInternals.java:345)

at
org.apache.curator.framework.recipes.locks.LockInternals.internalLockLoop(LockInternals.java:335)

at
org.apache.curator.framework.recipes.locks.LockInternals.attemptLock(LockInternals.java:225)

at
org.apache.curator.framework.recipes.locks.InterProcessMutex.internalLock(InterProcessMutex.java:221)

at
org.apache.curator.framework.recipes.locks.InterProcessMutex.acquire(InterProcessMutex.java:77)

at
org.apache.curator.framework.recipes.leader.LeaderSelector.doWork(LeaderSelector.java:385)

at
org.apache.curator.framework.recipes.leader.LeaderSelector.doWorkLoop(LeaderSelector.java:443)

at
org.apache.curator.framework.recipes.leader.LeaderSelector.access$100(LeaderSelector.java:63)

at
org.apache.curator.framework.recipes.leader.LeaderSelector$2.call(LeaderSelector.java:244)

at
org.apache.curator.framework.recipes.leader.LeaderSelector$2.call(LeaderSelector.java:238)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

at java.util.concurrent.FutureTask.run(FutureTask.java:166)

at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)

at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:334)

at java.util.concurrent.FutureTask.run(FutureTask.java:166)

at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)

at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)

at java.lang.Thread.run(Thread.java:724)

Mime
View raw message