CuratorFranework with Executor

36 views
Skip to first unread message

evaristo...@gmail.com

unread,
Mar 1, 2013, 6:08:52 PM3/1/13
to curato...@googlegroups.com
Hi there,

I am using CuratorFramework listeners providing an external executor (I am using Java newCachedThreadPool). It works fine to handle concurrency while receivent events in the listener.

But I have an issue when closing the CuratorFramework client. The issue is that some threads are leaked.

Before closing the close() method in CuratorFramework I am calling the shutdownNow method in the executor. What is the proper way to close the CuratorFramework client and Executor in order to avoid this problem? Do I need to handle the close event in the listener in any way (I assume that whne CuratorFramework client is closed the listeners are closed)

Thanks in advance, 

Evaristo


Jordan Zimmerman

unread,
Mar 6, 2013, 1:07:26 AM3/6/13
to curato...@googlegroups.com
The CuratorListener gets a CuratorEventType.CLOSING when closing. Other than that, your listeners need to handle InterruptedException which is what you'd get when you call shutdownNow().

-JZ

--
You received this message because you are subscribed to the Google Groups "curator-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to curator-user...@googlegroups.com.
To post to this group, send email to curato...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msg/curator-users/-/-mD01kUhtw8J.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Reply all
Reply to author
Forward
0 new messages