[jira] [Commented] (UIMA-5191) Free instance of agreggate with cas multiplier in MultiprocessingAnalysisEngine

2016-11-23 Thread Marshall Schor (JIRA)

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

Marshall Schor commented on UIMA-5191:
--

Nelson, can you build the uima-core jar from the current trunk and try the fix 
to see if it works for you?

> Free instance of agreggate with cas multiplier in 
> MultiprocessingAnalysisEngine
> ---
>
> Key: UIMA-5191
> URL: https://issues.apache.org/jira/browse/UIMA-5191
> Project: UIMA
>  Issue Type: Bug
>Affects Versions: 2.8.1SDK
>Reporter: Nelson RIvera
> Fix For: 3.0.0SDKexp, 2.9.1SDK
>
>
> I have a aggregate analysis engine that contains  2 casmultiplier
> annotators. I instantiate this aggregate with the interface
> UIMAFramework.produceAnalysisEngine(specifier, 1, 0) for multithreaded
> processing. The last casmultiplier generate more than one cas for each
> input CAS from first casmultiplier. The issue is that after first time that 
> the last casmultipler's hasNext method method returns false, the 
> MultiprocessingAnalysisEngine_impl assumes that the instance of
> AggregateAnalysisEngine that processes the request has ended, and
> then this instance is free to process ahother request from other thread, and 
> it is not true, because missing child cas to process from de first 
> casmultipler, producing concurrency errors.



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


[jira] [Commented] (UIMA-5191) Free instance of agreggate with cas multiplier in MultiprocessingAnalysisEngine

2016-11-22 Thread Marshall Schor (JIRA)

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

Marshall Schor commented on UIMA-5191:
--

just figured out a maybe simple fix... I'll check it in and then maybe you can 
try it.

> Free instance of agreggate with cas multiplier in 
> MultiprocessingAnalysisEngine
> ---
>
> Key: UIMA-5191
> URL: https://issues.apache.org/jira/browse/UIMA-5191
> Project: UIMA
>  Issue Type: Bug
>Affects Versions: 2.8.1SDK
>Reporter: Nelson RIvera
>
> I have a aggregate analysis engine that contains  2 casmultiplier
> annotators. I instantiate this aggregate with the interface
> UIMAFramework.produceAnalysisEngine(specifier, 1, 0) for multithreaded
> processing. The last casmultiplier generate more than one cas for each
> input CAS from first casmultiplier. The issue is that after first time that 
> the last casmultipler's hasNext method method returns false, the 
> MultiprocessingAnalysisEngine_impl assumes that the instance of
> AggregateAnalysisEngine that processes the request has ended, and
> then this instance is free to process ahother request from other thread, and 
> it is not true, because missing child cas to process from de first 
> casmultipler, producing concurrency errors.



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


[jira] [Commented] (UIMA-5191) Free instance of agreggate with cas multiplier in MultiprocessingAnalysisEngine

2016-11-22 Thread Marshall Schor (JIRA)

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

Marshall Schor commented on UIMA-5191:
--

hi, after some more thinking, it seems that UIMA's 
MultiprocessingAnalysisEngine's support for Cas Multipliers is not done 
properly.  I think your analysis is correct.  The 
MultiprocessingAnalysisEngine's implementation of processAndOutputNewCASes 
works as follows (somewhat simplified):
{code}
ae = getAeFromPool(); // get an AnalysisEngine (in this case, a cas multiplier)
JCasIterator theIterator = ae.processAndOutputNewCASes(aJCas);
// here's the bug !
mpool.releaseAnalysisEngine(ae); // return the Analysis Engine to the pool, 
  // way too early - it may produce more CASes...
return theIterator;
{code}

I don't see a simple way to fix this; so we'll note this and perhaps someone 
will figure out how to delay the return of the checked-out ae to the ae pool 
until after the iterator's "hasNext()" method gives false.

As a work-around, perhaps you could arrange to manage your own pool of threads, 
using Java's Executor mechanisms, and just instantiate an ordinary (not 
MultiThreaded) Analysis engine for each one.


> Free instance of agreggate with cas multiplier in 
> MultiprocessingAnalysisEngine
> ---
>
> Key: UIMA-5191
> URL: https://issues.apache.org/jira/browse/UIMA-5191
> Project: UIMA
>  Issue Type: Bug
>Affects Versions: 2.8.1SDK
>Reporter: Nelson RIvera
>
> I have a aggregate analysis engine that contains  2 casmultiplier
> annotators. I instantiate this aggregate with the interface
> UIMAFramework.produceAnalysisEngine(specifier, 1, 0) for multithreaded
> processing. The last casmultiplier generate more than one cas for each
> input CAS from first casmultiplier. The issue is that after first time that 
> the last casmultipler's hasNext method method returns false, the 
> MultiprocessingAnalysisEngine_impl assumes that the instance of
> AggregateAnalysisEngine that processes the request has ended, and
> then this instance is free to process ahother request from other thread, and 
> it is not true, because missing child cas to process from de first 
> casmultipler, producing concurrency errors.



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


[jira] [Commented] (UIMA-5191) Free instance of agreggate with cas multiplier in MultiprocessingAnalysisEngine

2016-11-22 Thread Nelson RIvera (JIRA)

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

Nelson RIvera commented on UIMA-5191:
-

the value of ActionAfterCasMultiplier in custom flow controller is "drop"

> Free instance of agreggate with cas multiplier in 
> MultiprocessingAnalysisEngine
> ---
>
> Key: UIMA-5191
> URL: https://issues.apache.org/jira/browse/UIMA-5191
> Project: UIMA
>  Issue Type: Bug
>Affects Versions: 2.8.1SDK
>Reporter: Nelson RIvera
>
> I have a aggregate analysis engine that contains  2 casmultiplier
> annotators. I instantiate this aggregate with the interface
> UIMAFramework.produceAnalysisEngine(specifier, 1, 0) for multithreaded
> processing. The last casmultiplier generate more than one cas for each
> input CAS from first casmultiplier. The issue is that after first time that 
> the last casmultipler's hasNext method method returns false, the 
> MultiprocessingAnalysisEngine_impl assumes that the instance of
> AggregateAnalysisEngine that processes the request has ended, and
> then this instance is free to process ahother request from other thread, and 
> it is not true, because missing child cas to process from de first 
> casmultipler, producing concurrency errors.



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


[jira] [Commented] (UIMA-5191) Free instance of agreggate with cas multiplier in MultiprocessingAnalysisEngine

2016-11-22 Thread Nelson RIvera (JIRA)

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

Nelson RIvera commented on UIMA-5191:
-

I use a custom flow controller. I rewrite continueOnFailure method, the value 
to return (true or false) is configured for each request in the computeFlow 
method.

> Free instance of agreggate with cas multiplier in 
> MultiprocessingAnalysisEngine
> ---
>
> Key: UIMA-5191
> URL: https://issues.apache.org/jira/browse/UIMA-5191
> Project: UIMA
>  Issue Type: Bug
>Affects Versions: 2.8.1SDK
>Reporter: Nelson RIvera
>
> I have a aggregate analysis engine that contains  2 casmultiplier
> annotators. I instantiate this aggregate with the interface
> UIMAFramework.produceAnalysisEngine(specifier, 1, 0) for multithreaded
> processing. The last casmultiplier generate more than one cas for each
> input CAS from first casmultiplier. The issue is that after first time that 
> the last casmultipler's hasNext method method returns false, the 
> MultiprocessingAnalysisEngine_impl assumes that the instance of
> AggregateAnalysisEngine that processes the request has ended, and
> then this instance is free to process ahother request from other thread, and 
> it is not true, because missing child cas to process from de first 
> casmultipler, producing concurrency errors.



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


[jira] [Commented] (UIMA-5191) Free instance of agreggate with cas multiplier in MultiprocessingAnalysisEngine

2016-11-22 Thread Marshall Schor (JIRA)

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

Marshall Schor commented on UIMA-5191:
--

To help understand the flow, what flow controller are you using for the 
Aggregate?  Is it the default "fixed flow", or did you write a custom flow?  
Did you specify "ActionAfterCasMultiplier" configuration parameter for the 
fixed flow (if you're using that), and if so, what value did you use?

> Free instance of agreggate with cas multiplier in 
> MultiprocessingAnalysisEngine
> ---
>
> Key: UIMA-5191
> URL: https://issues.apache.org/jira/browse/UIMA-5191
> Project: UIMA
>  Issue Type: Bug
>Affects Versions: 2.8.1SDK
>Reporter: Nelson RIvera
>
> I have a aggregate analysis engine that contains  2 casmultiplier
> annotators. I instantiate this aggregate with the interface
> UIMAFramework.produceAnalysisEngine(specifier, 1, 0) for multithreaded
> processing. The last casmultiplier generate more than one cas for each
> input CAS from first casmultiplier. The issue is that after first time that 
> the last casmultipler's hasNext method method returns false, the 
> MultiprocessingAnalysisEngine_impl assumes that the instance of
> AggregateAnalysisEngine that processes the request has ended, and
> then this instance is free to process ahother request from other thread, and 
> it is not true, because missing child cas to process from de first 
> casmultipler, producing concurrency errors.



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