[ 
https://issues.apache.org/jira/browse/CURATOR-223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14588840#comment-14588840
 ] 

ASF GitHub Bot commented on CURATOR-223:
----------------------------------------

GitHub user tdyas opened a pull request:

    https://github.com/apache/curator/pull/83

    Add .executorService methods to ServiceCacheBuilder

    Add .executorService variants to ServiceCacheBuilder to allow the caller to 
specify an ExecutorService or a CloseableExecutorService to be used by the 
PathChildrenCache embedded in ServiceCacheImpl.
    
    Extracts ExecuteCalledWatchingExecutorService (and 
DelegatingExecutorService) into the curator-test module for use by 
TestServiceCache.
    
    Relates to CURATOR-223

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/tdyas/curator service_cache_executor_service

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/curator/pull/83.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #83
    
----
commit d5e911eb8b8dc54455acdcf73e37a92d18fadc05
Author: Tom Dyas <[email protected]>
Date:   2015-06-16T21:38:18Z

    Add .executorService methods to ServiceCacheBuilder
    
    Add .executorService variants to ServiceCacheBuilder to allow the caller to 
specify
    an ExecutorService or a CloseableExecutorService to be used by the
    PathChildrenCache embedded in ServiceCacheImpl.
    
    Extracts ExecuteCalledWatchingExecutorService (and 
DelegatingExecutorService) into
    the curator-test module for use by TestServiceCache.
    
    Relates to CURATOR-223

----


> PathChildrenCache (wastefully) creates a thread per monitored node.
> -------------------------------------------------------------------
>
>                 Key: CURATOR-223
>                 URL: https://issues.apache.org/jira/browse/CURATOR-223
>             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 impact.
> 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
(v6.3.4#6332)

Reply via email to