You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cloudstack.apache.org by Alena Prokharchyk <Al...@citrix.com> on 2014/05/07 22:57:44 UTC

@ActionEvent generation doesn't work when method is called within the same manager context

Kelven/Darren,

While working on the fix for  CLOUDSTACK-6595, I’ve noticed that the methods annotated with @ActionEvents sometimes don’t generate the events. It happens when the annotated method is called within the same manager. When its called from another manager, the event is generated and inserted to cloud.events table. Kelven said its related to the Spring changes done by Darren.

Can you please take a look at it? Kelven, I’ve reassigned CLOUDSTACK-6595 to you (fix has to be submitted to 4.4-forward first, then cherry-picked to 4.4)

-Alena.

From: Alena Prokharchyk <al...@citrix.com>>
Date: Wednesday, May 7, 2014 at 1:53 PM
To: Daan Hoogland <da...@gmail.com>>, "dev@cloudstack.apache.org<ma...@cloudstack.apache.org>" <de...@cloudstack.apache.org>>
Subject: [ACS44] Cherry pick for CLOUDSTACK-6595

Daan, can you please cherry-pick the commit to 4.4 branch:

commit b9284db857cd001e75926cb7c49b6aff4ab63695
Author: Alena Prokharchyk <al...@citrix.com>>
Date:   Wed May 7 13:44:26 2014 -0700

    CLOUDSTACK-6595: call expunge method marked with @ActionEvent from expunge thread context. So the action even EXPUNGE.VM is generated when vm is expunged by the thread.

Thank you,
Alena.

Re: @ActionEvent generation doesn't work when method is called within the same manager context

Posted by Kelven Yang <ke...@citrix.com>.
When I first made Spring changes, to support @DB and @ActionEvents, I had to disable Spring Proxy mode so that the same semantics has been kept. I mentioned about the impact of this issue when switching to Spring proxy-based injection mode, for @DB, it has been taken care of with pre-setup done from ManagedContexts, but @ActionEvents will become victim, developers should be aware of that @ActionEvents will not be constantly work magically as before, this will post a big coding constancy problem.  If things can’t work consistently, I would suggestion to drop @ActionEvents at all, and ask developers always to publish events programmatically, unless we have a better solution for this.

Kelven

From: Darren Shepherd <da...@citrix.com>>
Date: Wednesday, May 7, 2014 at 2:30 PM
To: Alena Prokharchyk <Al...@citrix.com>>
Cc: Kelven Yang <ke...@citrix.com>>, "dev@cloudstack.apache.org<ma...@cloudstack.apache.org>" <de...@cloudstack.apache.org>>
Subject: Re: @ActionEvent generation doesn't work when method is called within the same manager context

Any call to this.method() will not process @ActionEvent annotation.  That is expected after the spring changes that were done.  There's no change that can be done to change that behavior, it's just how spring AOP work because it's proxy based.

If you want @ActionEvent to be processed you must cross beans, or just programmatically record the action event.

Darren

On May 7, 2014, at 1:57 PM, "Alena Prokharchyk" <Al...@citrix.com>> wrote:

Kelven/Darren,

While working on the fix for  CLOUDSTACK-6595, I’ve noticed that the methods annotated with @ActionEvents sometimes don’t generate the events. It happens when the annotated method is called within the same manager. When its called from another manager, the event is generated and inserted to cloud.events table. Kelven said its related to the Spring changes done by Darren.

Can you please take a look at it? Kelven, I’ve reassigned CLOUDSTACK-6595 to you (fix has to be submitted to 4.4-forward first, then cherry-picked to 4.4)

-Alena.

From: Alena Prokharchyk <al...@citrix.com>>
Date: Wednesday, May 7, 2014 at 1:53 PM
To: Daan Hoogland <da...@gmail.com>>, "dev@cloudstack.apache.org<ma...@cloudstack.apache.org>" <de...@cloudstack.apache.org>>
Subject: [ACS44] Cherry pick for CLOUDSTACK-6595

Daan, can you please cherry-pick the commit to 4.4 branch:

commit b9284db857cd001e75926cb7c49b6aff4ab63695
Author: Alena Prokharchyk <al...@citrix.com>>
Date:   Wed May 7 13:44:26 2014 -0700

    CLOUDSTACK-6595: call expunge method marked with @ActionEvent from expunge thread context. So the action even EXPUNGE.VM is generated when vm is expunged by the thread.

Thank you,
Alena.

Re: @ActionEvent generation doesn't work when method is called within the same manager context

Posted by Darren Shepherd <da...@citrix.com>.
Any call to this.method() will not process @ActionEvent annotation.  That is expected after the spring changes that were done.  There's no change that can be done to change that behavior, it's just how spring AOP work because it's proxy based.

If you want @ActionEvent to be processed you must cross beans, or just programmatically record the action event.

Darren

On May 7, 2014, at 1:57 PM, "Alena Prokharchyk" <Al...@citrix.com>> wrote:

Kelven/Darren,

While working on the fix for  CLOUDSTACK-6595, I’ve noticed that the methods annotated with @ActionEvents sometimes don’t generate the events. It happens when the annotated method is called within the same manager. When its called from another manager, the event is generated and inserted to cloud.events table. Kelven said its related to the Spring changes done by Darren.

Can you please take a look at it? Kelven, I’ve reassigned CLOUDSTACK-6595 to you (fix has to be submitted to 4.4-forward first, then cherry-picked to 4.4)

-Alena.

From: Alena Prokharchyk <al...@citrix.com>>
Date: Wednesday, May 7, 2014 at 1:53 PM
To: Daan Hoogland <da...@gmail.com>>, "dev@cloudstack.apache.org<ma...@cloudstack.apache.org>" <de...@cloudstack.apache.org>>
Subject: [ACS44] Cherry pick for CLOUDSTACK-6595

Daan, can you please cherry-pick the commit to 4.4 branch:

commit b9284db857cd001e75926cb7c49b6aff4ab63695
Author: Alena Prokharchyk <al...@citrix.com>>
Date:   Wed May 7 13:44:26 2014 -0700

    CLOUDSTACK-6595: call expunge method marked with @ActionEvent from expunge thread context. So the action even EXPUNGE.VM is generated when vm is expunged by the thread.

Thank you,
Alena.