Typically when you call "close" on the ZooKeeper object it will shut down
both the threads (one is the "send" thread, the other is the "event"
thread). Are you sure you're calling the close method?

Perhaps you've found this issue?


On Tue, Aug 24, 2010 at 7:45 AM, Maarten Koopmans <maar...@vrijheid.net>wrote:

> Hi,
> I am using the Zookeeper Java client class from Scala for some synchronous
> communication (no watches, no async). Fairly simple. Every now and then my
> application needs to use ZK and then creates a client, does its thing, and
> closes the client.
> What happens though is that I keep having two threads for every client I've
> ever opened, which slowly adds up. So now I turned the client into a
> Singleton, but that acts as a bottleneck (remember, I do/need sync
> communication).
> Any thoughts? From my perspective, the close() method on ZooKeeper should
> close and clean up the threads. Tested under OS 10.6.4 and Ubuntu 10.04 with
> the Sun JDK.
> Thanks,
> Maarten

Reply via email to