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

Marshall Schor edited comment on UIMA-5156 at 10/24/16 11:59 PM:
-----------------------------------------------------------------

I could put in an automatic destroy call in this case:
* the user lets the UIMA Framework create the RM as a side effect of a call to 
produceResource, etc., and
* the user never asks that resource for the RM.

In that case, we can guarantee nothing bad will come of destroying this when 
the pipeline is destroyed (except in some weird unrealistic cases, such as 
destroying the resource, and then doing a call to get the destroyed resource's 
RM.).

I wonder if this will cover enough use cases to be useful?

Maybe we could also detect when a RM is passed to a produceResource or RM.copy, 
from a non-framework source, and then mark that RM to *not* do auto-destroy.  
This might catch the problematic use case described above.


was (Author: schor):
I could put in an automatic destroy call in this case:
* the user lets the UIMA Framework create the RM as a side effect of a call to 
produceResource, etc., and
* the user never asks that resource for the RM.

In that case, we can guarantee nothing bad will come of destroying this when 
the pipeline is destroyed (except in some weird unrealistic cases, such as 
destroying the resource, and then doing a call to get the destroyed resource's 
RM.).

I wonder if this will cover enough use cases to be useful?

> ResourceManager automatic destory
> ---------------------------------
>
>                 Key: UIMA-5156
>                 URL: https://issues.apache.org/jira/browse/UIMA-5156
>             Project: UIMA
>          Issue Type: Improvement
>            Reporter: Marshall Schor
>            Priority: Minor
>
> UIMA-2977 adds a destory() method to the ResourceManager (RM), that forwards 
> this call to external resources managed by that RM.
> The destroy() method was not called by the framework, because in general the 
> RM may be shared by the user (or framework) among multiple pipelines.
> This Jira is to enable RMs created by the framework to call destroy() 
> internally at the appropriate time.
> This assumes that the right time can be figured out for the various cases.
> These include: MultiprocessingAnalysisEngine_impl, and fixing other 
> associated frameworks which may use a pattern where they 
> * let the framework create a RM, but then 
> * use that in other contexts.  



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to