[infinispan-issues] [JBoss JIRA] (ISPN-2464) Allow DistributedExecutorService to control shutdown of given local ExecutorService

Vladimir Blagojevic (JIRA) jira-events at lists.jboss.org
Fri Nov 2 12:11:18 EDT 2012


     [ https://issues.jboss.org/browse/ISPN-2464?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Vladimir Blagojevic updated ISPN-2464:
--------------------------------------

    Git Pull Request: https://github.com/infinispan/infinispan/pull/1443
         Description: 
Constructors that receive a thread pool from clients not shut it down on stop: it's a good rule of resource management for the creator of the resource (thread pool for us) to manage the shutdown as well.
So here's how I think this can be solved:
1. Add a new Ctor that besides the pool also has a flag to allow us to take ownership of the pool (i.e. we'll destroy it when the DistExec is shutdow)
2. leave the current constructor as it is, make it internally invoke 1. with takeOwnership=true (this would preserve backward compatibility)
3. amend the executor to only shutdown the thread pool if it has ownership
4. document the threadpool ownership in all constructors


  was:

Constructors that receive a thread pool from clients not shut it down on stop: it's a good rule of resource management for the creator of the resource (thread pool for us) to manage the shutdown as well.
So here's how I think this can be solved:
1. Add a new Ctor that besides the pool also has a flag to allow us to take ownership of the pool (i.e. we'll destroy it when the DistExec is shutdow)
2. leave the current constructor as it is, make it internally invoke 1. with takeOwnership=true (this would preserve backward compatibility)
3. amend the executor to only shutdown the thread pool if it has ownership
4. document the threadpool ownership in all constructors



    
> Allow DistributedExecutorService to control shutdown of given local ExecutorService
> -----------------------------------------------------------------------------------
>
>                 Key: ISPN-2464
>                 URL: https://issues.jboss.org/browse/ISPN-2464
>             Project: Infinispan
>          Issue Type: Feature Request
>          Components: Distributed Execution and Map/Reduce
>    Affects Versions: 5.2.0.Beta3
>            Reporter: Vladimir Blagojevic
>            Assignee: Vladimir Blagojevic
>             Fix For: 5.2.0.CR1, 5.2.0.Final
>
>
> Constructors that receive a thread pool from clients not shut it down on stop: it's a good rule of resource management for the creator of the resource (thread pool for us) to manage the shutdown as well.
> So here's how I think this can be solved:
> 1. Add a new Ctor that besides the pool also has a flag to allow us to take ownership of the pool (i.e. we'll destroy it when the DistExec is shutdow)
> 2. leave the current constructor as it is, make it internally invoke 1. with takeOwnership=true (this would preserve backward compatibility)
> 3. amend the executor to only shutdown the thread pool if it has ownership
> 4. document the threadpool ownership in all constructors

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira


More information about the infinispan-issues mailing list