You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@uima.apache.org by "Adam Lally (JIRA)" <ui...@incubator.apache.org> on 2008/10/31 20:33:44 UTC

[jira] Created: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Annotators should be initialized in the same thread that their process method will later be called on
-----------------------------------------------------------------------------------------------------

                 Key: UIMA-1223
                 URL: https://issues.apache.org/jira/browse/UIMA-1223
             Project: UIMA
          Issue Type: Bug
          Components: Async Scaleout
    Affects Versions: 2.2.2
            Reporter: Adam Lally
            Assignee: Jerry Cwiklik


It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Posted by "Adam Lally (JIRA)" <ui...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655240#action_12655240 ] 

Adam Lally commented on UIMA-1223:
----------------------------------

There is a problem in this patch due to UIMA-1248, which causes concurrent initialization of AE instances sharing a ResourceManager to fail intermittently.  We should work around this by synchronizing the call to UIMAFramework.produceAnalysisEngine so that only one instance can be initialized at a time, until UIMA-1248 gets fixed.

> Annotators should be initialized in the same thread that their process method will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Posted by "Jerry Cwiklik (JIRA)" <ui...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerry Cwiklik updated UIMA-1223:
--------------------------------

    Priority: Minor  (was: Major)

Dropping priority until UIMA-1248 (core uima) is addressed. Until then, the approach is to synchronize code in the Primitive Controller that calls produceAnalysisEngine() . The code instantiates AEs serially.

> Annotators should be initialized in the same thread that their process method will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>            Priority: Minor
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Posted by "Jerry Cwiklik (JIRA)" <ui...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerry Cwiklik updated UIMA-1223:
--------------------------------


Deferred beyond 2.3.0 release

> Annotators should be initialized in the same thread that their process method will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>            Priority: Minor
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Posted by "Jerry Cwiklik (JIRA)" <ui...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerry Cwiklik updated UIMA-1223:
--------------------------------

    Attachment: uimaj-as-core-UIMA-1223-patch.txt
                uimaj-as-activemq-UIMA-1223-patch.txt

Added custom Thread factory to the ThreadPoolTaskExecutor that creates threads which  Initialize AEs in a primitive controller. Subsequently, a thread that initialized AE will be called to call process method on that AE instance. Modified primitive controller to create resource specifier in the same thread that will create AE instance.

Modified UimaDefaultMessageListenerContainer, to wait for all threads to stop.

> Annotators should be initialized in the same thread that their process method will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Closed: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Posted by "Jerry Cwiklik (JIRA)" <ui...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerry Cwiklik closed UIMA-1223.
-------------------------------

    Resolution: Fixed

Created a single (static) instance of a semaphore with one permit to control access to the core's produceAnalysisEngine() method.  This semaphore is shared by all instances of UIMA AS PrimitiveController in a jvm.  

> Annotators should be initialized in the same thread that their process method will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>            Priority: Minor
>             Fix For: 2.3AS
>
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Reopened: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Posted by "Jerry Cwiklik (JIRA)" <ui...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerry Cwiklik reopened UIMA-1223:
---------------------------------


Current synchronization approach to guard UIMAFramework.produceAnalysisEngine() from being accessed by multiple threads is not working. The current approach synchronizes access to the above by using instance variable called mux of type Object. This works fine in the top level UIMA AS primitive controller where there is always a single instance producing AEs. In the UIMA AS aggregate controller there may be multiple instances of   UIMA As primitive controller. There is a chance that these instances can initialize their AEs at the same time and access UIMA core's code that is not thread safe. Synchronize access to UIMAFramework.produceAnalysisEngine() using static semaphore instance with a single permit. There will be a single instance of the semaphore per jvm guaranteeing correct serialized access to the core's code. 


> Annotators should be initialized in the same thread that their process method will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>            Priority: Minor
>             Fix For: 2.3AS
>
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Posted by "Marshall Schor (JIRA)" <ui...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Marshall Schor resolved UIMA-1223.
----------------------------------

    Resolution: Fixed

This is fixed, but in a way that forces serialization.  Revisit when linked issue addressed

> Annotators should be initialized in the same thread that their process method will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>            Priority: Minor
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Posted by "Marshall Schor (JIRA)" <ui...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655226#action_12655226 ] 

Marshall Schor commented on UIMA-1223:
--------------------------------------

Please see UIMA-1201 - should the code that waits for all threads to stop make an exception for "daemon" threads?

> Annotators should be initialized in the same thread that their process method will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Issue Comment Edited: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Posted by "Marshall Schor (JIRA)" <ui...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12655226#action_12655226 ] 

schor edited comment on UIMA-1223 at 12/10/08 7:43 AM:
----------------------------------------------------------------

Comment deleted - was a ref to UIMA-1201, which was subsequently closed with a "won't fix" resolution

      was (Author: schor):
    Please see UIMA-1201 - should the code that waits for all threads to stop make an exception for "daemon" threads?
  
> Annotators should be initialized in the same thread that their process method will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Posted by "Eddie Epstein (JIRA)" <ui...@incubator.apache.org>.
    [ https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656169#action_12656169 ] 

Eddie Epstein commented on UIMA-1223:
-------------------------------------

Initializing an aggregate service failed with the stack below.
It appears that this is due to a thread synchronization problem with the unregisteredDelegateList.
Jerry, please see TODO questions associated with this change.

java.lang.NullPointerException
	at org.apache.uima.aae.controller.AggregateAnalysisEngineController_impl.mergeTypeSystem(AggregateAnalysisEngineController_impl.java:1995)
	at org.apache.uima.aae.handler.input.MetadataResponseHandler_impl.handle(MetadataResponseHandler_impl.java:76)
	at org.apache.uima.aae.handler.input.MetadataRequestHandler_impl.handle(MetadataRequestHandler_impl.java:84)
	at org.apache.uima.aae.handler.HandlerBase.delegate(HandlerBase.java:157)
	at org.apache.uima.aae.handler.input.ProcessResponseHandler.handle(ProcessResponseHandler.java:696)
	at org.apache.uima.aae.handler.HandlerBase.delegate(HandlerBase.java:157)
	at org.apache.uima.aae.handler.input.ProcessRequestHandler_impl.handle(ProcessRequestHandler_impl.java:880)
	at org.apache.uima.aae.spi.transport.vm.UimaVmMessageListener.onMessage(UimaVmMessageListener.java:99)
	at org.apache.uima.aae.spi.transport.vm.UimaVmMessageDispatcher$1.run(UimaVmMessageDispatcher.java:66)
	at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(ThreadPoolExecutor.java:650)
	at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:675)
	at java.lang.Thread.run(Thread.java:595)

> Annotators should be initialized in the same thread that their process method will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (UIMA-1223) Annotators should be initialized in the same thread that their process method will later be called on

Posted by "Jerry Cwiklik (JIRA)" <ui...@incubator.apache.org>.
     [ https://issues.apache.org/jira/browse/UIMA-1223?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jerry Cwiklik updated UIMA-1223:
--------------------------------

    Fix Version/s: 2.3AS

> Annotators should be initialized in the same thread that their process method will later be called on
> -----------------------------------------------------------------------------------------------------
>
>                 Key: UIMA-1223
>                 URL: https://issues.apache.org/jira/browse/UIMA-1223
>             Project: UIMA
>          Issue Type: Bug
>          Components: Async Scaleout
>    Affects Versions: 2.2.2
>            Reporter: Adam Lally
>            Assignee: Jerry Cwiklik
>            Priority: Minor
>             Fix For: 2.3AS
>
>         Attachments: uimaj-as-activemq-UIMA-1223-patch.txt, uimaj-as-core-UIMA-1223-patch.txt
>
>
> It is more convenient if an annotator is initialized on the same thread that it is later called on.  Some components may use thread-local data and they won't work in UIMA-AS currently.  Another advantage of doing the initialization in the processing thread is that you could initialize multiple instances of the annotator in parallel instead of sequentially, which may be faster for a multi-core machine.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.