curator-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <>
Subject [jira] [Commented] (CURATOR-223) PathChildrenCache (wastefully) creates a thread per monitored node.
Date Wed, 17 Jun 2015 15:46:00 GMT


ASF GitHub Bot commented on CURATOR-223:

Github user tdyas commented on a diff in the pull request:
    --- Diff: curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/
    @@ -66,6 +68,18 @@
    +    ServiceCacheImpl(ServiceDiscoveryImpl<T> discovery, String name, CloseableExecutorService
    --- End diff --
    Will do. I had to add a conversion from `ThreadFactory` to `CloseableExecutorService`
in a static method since Java doesn't permit ctor's to have code before the call to the common

> PathChildrenCache (wastefully) creates a thread per monitored node.
> -------------------------------------------------------------------
>                 Key: CURATOR-223
>                 URL:
>             Project: Apache Curator
>          Issue Type: Improvement
>          Components: Recipes
>    Affects Versions: 2.7.1
>            Reporter: Tom Dyas
> PathChildrenCache creates a single-threaded executor. In the aggregate, this means there
is a thread for every monitored node.
> In my company's use case, we use ServiceCache (which uses PathChildrenCache) to monitor
service discovery nodes for the locations of many sharded immutable key/value stores used
by our services. We saw in excess of 250 threads devoted to the PathChildrenCache's used by
ServiceCache. These threads were all parked so there was negligible CPU impact, but there
is still the memory/stack impact of having so many idle threads. We would like to avoid that
> I'd like to modify PathChildrenCache to take an ExecutorService as an alternate to the
ThreadFactory it currently takes. This would allow me to pass in a thread pool for my company's
use case.
> Are there any issues with which I should be concerned concerning PathChildrenCache's
use of separate threads? (Non-reentrancy from watcher-invoked code? Binary compatibility?)

This message was sent by Atlassian JIRA

View raw message