You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@curator.apache.org by "ASF GitHub Bot (Jira)" <ji...@apache.org> on 2020/01/27 21:36:00 UTC

[jira] [Work logged] (CURATOR-557) ServiceCacheImpl does not close ExecutorService

     [ https://issues.apache.org/jira/browse/CURATOR-557?focusedWorklogId=377853&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-377853 ]

ASF GitHub Bot logged work on CURATOR-557:
------------------------------------------

                Author: ASF GitHub Bot
            Created on: 27/Jan/20 21:35
            Start Date: 27/Jan/20 21:35
    Worklog Time Spent: 10m 
      Work Description: shayshim commented on pull request #343: [CURATOR-557] ServiceCacheImpl does not close ExecutorService
URL: https://github.com/apache/curator/pull/343#discussion_r371474832
 
 

 ##########
 File path: curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceProviderImpl.java
 ##########
 @@ -43,13 +46,21 @@
     private final ProviderStrategy<T> providerStrategy;
     private final DownInstanceManager<T> downInstanceManager;
 
-    public ServiceProviderImpl(ServiceDiscoveryImpl<T> discovery, String serviceName, ProviderStrategy<T> providerStrategy, ThreadFactory threadFactory, List<InstanceFilter<T>> filters, DownInstancePolicy downInstancePolicy)
+    public ServiceProviderImpl(ServiceDiscoveryImpl<T> discovery, String serviceName, ProviderStrategy<T> providerStrategy, ThreadFactory threadFactory, CloseableExecutorService executorService, List<InstanceFilter<T>> filters, DownInstancePolicy downInstancePolicy)
 
 Review comment:
   This constructor is `public` (can be used directly, skipping `ServiceProviderBuilder`), and now it accepts both `ThreadFactory` and `CloseableExecutorService`, which can be confusing. 
   I suggest to make this constructor package-private and add 2 `public` constructors: one that accepts all arguments as this one but only `ThreadFactory` (no `CloseableExecutorService`) and second that accepts all arguments as this one but only `CloseableExecutorService` (no `ThreadFactory`). Both will delegate to this constructor (with `null` as the missing argument).
 
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Issue Time Tracking
-------------------

    Worklog Id:     (was: 377853)
    Time Spent: 20m  (was: 10m)

> ServiceCacheImpl does not close ExecutorService
> -----------------------------------------------
>
>                 Key: CURATOR-557
>                 URL: https://issues.apache.org/jira/browse/CURATOR-557
>             Project: Apache Curator
>          Issue Type: Bug
>          Components: Framework
>    Affects Versions: 4.2.0
>            Reporter: Roelof Naude
>            Priority: Major
>         Attachments: CURATOR-557.patch
>
>          Time Spent: 20m
>  Remaining Estimate: 0h
>
> ServiceCacheImpl does not close the ExecutorService instance created from the ThreadFactory:
> [https://github.com/apache/curator/blob/master/curator-x-discovery/src/main/java/org/apache/curator/x/discovery/details/ServiceCacheImpl.java#L64]
>  
> CloseableExecutorService::CloseableExecutorService(ExecutorService) call this(executorService, false) which sets shutdownOnClose to false. 
>  
> this has an impact from callers, eg ServiceProviderImpl, which only allow only a ThreadFactory to be specified.
>  
>  



--
This message was sent by Atlassian Jira
(v8.3.4#803005)