curator-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Raji Muthupandian <raji...@gmail.com>
Subject Curator Framework Close() is NOT always shutting down ConnectionStateManager threads
Date Fri, 07 Feb 2014 21:35:38 GMT
Hi Team,
     We have 5 server Zookeeper ensemble. If any one of the server goes
down, connections are balanced to remaining servers. When the down server
comes back, there will not be any connections to this server unless new
clients are connected or connectionLoss happens at client side. This makes
a unequal connection distribution to the servers.

To avoid this, we thought of having a connection balancer task which closes
the existing connection and creates new connection on every configured time
interval. As part of connection close, we call Curatorframework.close().
        But in some instances , ConnectionStateManager threads are not
closed. Threads are still in WAITING state to take events from eventqueue.

"ConnectionStateManager-0" - Thread t@272
   java.lang.Thread.State: WAITING
    at sun.misc.Unsafe.park(Native Method)
    - parking to wait for <3be45251> (a
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject)
    at java.util.concurrent.locks.LockSupport.park(LockSupport.java:186)
    at
java.util.concurrent.locks.AbstractQueuedSynchronizer$ConditionObject.await(AbstractQueuedSynchronizer.java:2043)
    at
java.util.concurrent.ArrayBlockingQueue.take(ArrayBlockingQueue.java:374)
    at
com.netflix.curator.framework.state.ConnectionStateManager.processEvents(ConnectionStateManager.java:170)
    at
com.netflix.curator.framework.state.ConnectionStateManager.access$000(ConnectionStateManager.java:40)
    at
com.netflix.curator.framework.state.ConnectionStateManager$1.call(ConnectionStateManager.java:104)
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
    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

This creates lot of dangling threads over a period of time. Is there a way
to cleanly close the connections ?

is there any better approach to handle connection balancing....

Thanks
Raji

Mime
View raw message