You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@aries.apache.org by "Rick McGuire (JIRA)" <ji...@apache.org> on 2009/10/01 15:31:25 UTC

[jira] Created: (ARIES-12) BlueprintListener events are not delivered synchronously

BlueprintListener events are not delivered synchronously
--------------------------------------------------------

                 Key: ARIES-12
                 URL: https://issues.apache.org/jira/browse/ARIES-12
             Project: Aries
          Issue Type: Bug
          Components: Blueprint
            Reporter: Rick McGuire


Section 121.12 of the blueprint specification has a requirement that blueprint events be delivered to BlueprintListener.blueprintEvent() methods.  However, the implementation of the event dispatcher submits the callbacks for each event to an executor for processing, leading to race conditions where events can be delivered out of order.  These events really should be placed on a queue and all callbacks completely processed in order. 

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


[jira] Updated: (ARIES-12) BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored

Posted by "Alan Cabrera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Cabrera updated ARIES-12:
------------------------------

    Description: 
The spec states that the events must be delivered synchronously. "These events are send synchronously with their cause. That is, all listeners must be notified before the Blueprint Container continues to the next step." So we must not use a thread pool to deliver.

It also states "Blueprint Listener services that throw Exceptions or do not return in a reasonable time as judged by the Blueprint extender implementation, should be logged, if possible, and further ignored." We don't do this.


  was:Section 121.12 of the blueprint specification has a requirement that blueprint events be delivered to BlueprintListener.blueprintEvent() methods.  However, the implementation of the event dispatcher submits the callbacks for each event to an executor for processing, leading to race conditions where events can be delivered out of order.  These events really should be placed on a queue and all callbacks completely processed in order. 


> BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored
> ------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>
> The spec states that the events must be delivered synchronously. "These events are send synchronously with their cause. That is, all listeners must be notified before the Blueprint Container continues to the next step." So we must not use a thread pool to deliver.
> It also states "Blueprint Listener services that throw Exceptions or do not return in a reasonable time as judged by the Blueprint extender implementation, should be logged, if possible, and further ignored." We don't do this.

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


[jira] Assigned: (ARIES-12) BlueprintListener events are not delivered synchronously

Posted by "Alan Cabrera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Cabrera reassigned ARIES-12:
---------------------------------

    Assignee: Alan Cabrera

Mind if I take a crack at this?

> BlueprintListener events are not delivered synchronously
> --------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>
> Section 121.12 of the blueprint specification has a requirement that blueprint events be delivered to BlueprintListener.blueprintEvent() methods.  However, the implementation of the event dispatcher submits the callbacks for each event to an executor for processing, leading to race conditions where events can be delivered out of order.  These events really should be placed on a queue and all callbacks completely processed in order. 

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


[jira] Commented: (ARIES-12) BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored

Posted by "Alan Cabrera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761577#action_12761577 ] 

Alan Cabrera commented on ARIES-12:
-----------------------------------

I don't believe that this is true.  It explicitly states "That is, all listeners must be notified before the Blueprint Container continues to the next step.".  The core spec also uses the language of synchronous delivery for synchronous bundle listeners which we know the events get delivered before the framework continues.

There is also other language in the core spec that discusses that it's ok to asynchronously deliver messages to "regular" bundle listeners so long as the order of the events is maintained.  This is the behavior to which you speak above.  That language does not refer to such delivery as synchronous.

> BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored
> ------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>
> The spec states that the events must be delivered synchronously. "These events are send synchronously with their cause. That is, all listeners must be notified before the Blueprint Container continues to the next step." So we must not use a thread pool to deliver.
> It also states "Blueprint Listener services that throw Exceptions or do not return in a reasonable time as judged by the Blueprint extender implementation, should be logged, if possible, and further ignored." We don't do this.

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


[jira] Reopened: (ARIES-12) BlueprintListener events are not delivered synchronously

Posted by "Alan Cabrera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Cabrera reopened ARIES-12:
-------------------------------


There are still the other issues that I mentioned.  One still has to do with the fact that events are still not delivered synchronously since there's a thread pool in the dispatcher.  The other is most likely a new issue that needs to be filed.

Please comment.

> BlueprintListener events are not delivered synchronously
> --------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>
> Section 121.12 of the blueprint specification has a requirement that blueprint events be delivered to BlueprintListener.blueprintEvent() methods.  However, the implementation of the event dispatcher submits the callbacks for each event to an executor for processing, leading to race conditions where events can be delivered out of order.  These events really should be placed on a queue and all callbacks completely processed in order. 

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


[jira] Commented: (ARIES-12) BlueprintListener events are not delivered synchronously

Posted by "Alan Cabrera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761480#action_12761480 ] 

Alan Cabrera commented on ARIES-12:
-----------------------------------

As I read the code it seems that events are already placed on a queue.  Executors.newSingleThreadExecutor() returns an ExecutorService that uses a queue to feed the "pool".  Is there a TCK test that's failing on this?

However, as I read the spec more carefully it states that the events must be delivered synchronously.  "These events are send synchronously with their cause. That is, all listeners must be notified before the Blueprint Container continues to the next step."  So we must not use a thread pool to deliver.  

It also states "Blueprint Listener services that throw Exceptions or do not return in a reasonable time as judged by the Blueprint extender implementation, should be logged, if possible, and further ignored."  We don't do this.

> BlueprintListener events are not delivered synchronously
> --------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>
> Section 121.12 of the blueprint specification has a requirement that blueprint events be delivered to BlueprintListener.blueprintEvent() methods.  However, the implementation of the event dispatcher submits the callbacks for each event to an executor for processing, leading to race conditions where events can be delivered out of order.  These events really should be placed on a queue and all callbacks completely processed in order. 

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


[jira] Commented: (ARIES-12) BlueprintListener events are not delivered synchronously

Posted by "Rick McGuire (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761226#action_12761226 ] 

Rick McGuire commented on ARIES-12:
-----------------------------------

Be my guest.  I didn't assign this one to me because I didn't have a simple fix in mind yet.  Glad to have a volunteer :-)

> BlueprintListener events are not delivered synchronously
> --------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>
> Section 121.12 of the blueprint specification has a requirement that blueprint events be delivered to BlueprintListener.blueprintEvent() methods.  However, the implementation of the event dispatcher submits the callbacks for each event to an executor for processing, leading to race conditions where events can be delivered out of order.  These events really should be placed on a queue and all callbacks completely processed in order. 

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


[jira] Updated: (ARIES-12) BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored

Posted by "Alan Cabrera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Cabrera updated ARIES-12:
------------------------------

    Summary: BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored  (was: BlueprintListener events are not delivered synchronously)

> BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored
> ------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>
> Section 121.12 of the blueprint specification has a requirement that blueprint events be delivered to BlueprintListener.blueprintEvent() methods.  However, the implementation of the event dispatcher submits the callbacks for each event to an executor for processing, leading to race conditions where events can be delivered out of order.  These events really should be placed on a queue and all callbacks completely processed in order. 

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


[jira] Commented: (ARIES-12) BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored

Posted by "Alan Cabrera (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12762035#action_12762035 ] 

Alan Cabrera commented on ARIES-12:
-----------------------------------

I imagine that it's for listeners to participate in the "lifecycle".  These listeners need to know about blueprint changes right then and there, not at some arbitrary time after the fact. 

> BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored
> ------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>
> The spec states that the events must be delivered synchronously. "These events are send synchronously with their cause. That is, all listeners must be notified before the Blueprint Container continues to the next step." So we must not use a thread pool to deliver.
> It also states "Blueprint Listener services that throw Exceptions or do not return in a reasonable time as judged by the Blueprint extender implementation, should be logged, if possible, and further ignored." We don't do this.

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


[jira] Commented: (ARIES-12) BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored

Posted by "Niclas Hedhman (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761808#action_12761808 ] 

Niclas Hedhman commented on ARIES-12:
-------------------------------------

I agree with Alan's assessment here. The OSGi specs are very explicit when it comes to event delievery. 
I can agree with Rick that I don't understand why the text says it must be synchronously, though, but that is a lost battle by now.

> BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored
> ------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>
> The spec states that the events must be delivered synchronously. "These events are send synchronously with their cause. That is, all listeners must be notified before the Blueprint Container continues to the next step." So we must not use a thread pool to deliver.
> It also states "Blueprint Listener services that throw Exceptions or do not return in a reasonable time as judged by the Blueprint extender implementation, should be logged, if possible, and further ignored." We don't do this.

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


[jira] Closed: (ARIES-12) BlueprintListener events are not delivered synchronously

Posted by "Rick McGuire (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Rick McGuire closed ARIES-12.
-----------------------------

    Resolution: Invalid

Ah, I missed the point that this was using the single thread executor.  My original reading was that the event dispatch would get handled currently on multiple threads because it was using the ExecutorService.  

> BlueprintListener events are not delivered synchronously
> --------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>
> Section 121.12 of the blueprint specification has a requirement that blueprint events be delivered to BlueprintListener.blueprintEvent() methods.  However, the implementation of the event dispatcher submits the callbacks for each event to an executor for processing, leading to race conditions where events can be delivered out of order.  These events really should be placed on a queue and all callbacks completely processed in order. 

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


[jira] Resolved: (ARIES-12) BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored

Posted by "Alan Cabrera (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Alan Cabrera resolved ARIES-12.
-------------------------------

       Resolution: Fixed
    Fix Version/s: 1.0

> BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored
> ------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>             Fix For: 1.0
>
>
> The spec states that the events must be delivered synchronously. "These events are send synchronously with their cause. That is, all listeners must be notified before the Blueprint Container continues to the next step." So we must not use a thread pool to deliver.
> It also states "Blueprint Listener services that throw Exceptions or do not return in a reasonable time as judged by the Blueprint extender implementation, should be logged, if possible, and further ignored." We don't do this.

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


[jira] Commented: (ARIES-12) BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored

Posted by "Rick McGuire (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12761575#action_12761575 ] 

Rick McGuire commented on ARIES-12:
-----------------------------------

I'd don't believe this is an issue. synchrously, I believe, refers to having an ordering to the delivered events, not that processing needs to be delayed until all of the events have been delivered. 

> BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored
> ------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>
> The spec states that the events must be delivered synchronously. "These events are send synchronously with their cause. That is, all listeners must be notified before the Blueprint Container continues to the next step." So we must not use a thread pool to deliver.
> It also states "Blueprint Listener services that throw Exceptions or do not return in a reasonable time as judged by the Blueprint extender implementation, should be logged, if possible, and further ignored." We don't do this.

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


[jira] Updated: (ARIES-12) BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored

Posted by "Jeremy Hughes (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/ARIES-12?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jeremy Hughes updated ARIES-12:
-------------------------------

    Fix Version/s:     (was: 1.0)
                   0.1

> BlueprintListener events are not delivered synchronously and bad/tardy listeners are not ignored
> ------------------------------------------------------------------------------------------------
>
>                 Key: ARIES-12
>                 URL: https://issues.apache.org/jira/browse/ARIES-12
>             Project: Aries
>          Issue Type: Bug
>          Components: Blueprint
>            Reporter: Rick McGuire
>            Assignee: Alan Cabrera
>             Fix For: 0.1
>
>
> The spec states that the events must be delivered synchronously. "These events are send synchronously with their cause. That is, all listeners must be notified before the Blueprint Container continues to the next step." So we must not use a thread pool to deliver.
> It also states "Blueprint Listener services that throw Exceptions or do not return in a reasonable time as judged by the Blueprint extender implementation, should be logged, if possible, and further ignored." We don't do this.

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