You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ode.apache.org by Sathwik <ba...@intalio.com> on 2012/03/19 08:36:30 UTC

Serious bug-ODE allows activating a retired process when there is already an active version

Hi,

I came across this problem while using the Intalio server. I think this 
problem exists in ODE as well.

Though I don't how to test this with a testcase, any idea?

Steps to reproduce:
1) Deploy a process to the server (V1)
2) Deploy the process again (V2)
3) V1: Retired and V2: Active
4) Now activate (Process package)  V1 which is in Retired state.
5) An exception is thrown ContextException("Can't activate two processes 
of the same name:....)
6) Now check the status of V1 and V2, you can see that both the versions 
V1 and V2 are Active.

Upon Analysis of the code this is what I found:
org.apache.ode.store.ProcessStoreImpl.setState(QName, ProcessState)
a) Update the state of the process in database (this call runs in a 
transaction and gets committed upon success)
b) Fire state change event

The event fired in (b) is handled in 
org.apache.ode.axis2.ODEServer.handleEvent(ProcessStoreEvent) which then 
lands up in the below method 
org.apache.ode.bpel.engine.BpelEngineImpl.registerProcess(BpelProcess). 
The below code snippet finally creates the exception.

if (cachedVersion.getConf().getState() == ProcessState.ACTIVE
&& process.getConf().getState() == ProcessState.ACTIVE
&& !OdeGlobalConfig.autoRetireProcess()) {
     throw new ContextException("Can't activate two processes of the 
same name: " + process.getConf().getPackage() + ", " + 
cachedVersion.getConf().getPackage() + ", name: " + 
process.getProcessType());
}

The problem is now since in (a) the state is already updated and 
committed and (b) is throwing an runtime exception, but this has no 
effect and hence the stated problem.

regards,
sathwik

Re: Serious bug-ODE allows activating a retired process when there is already an active version

Posted by Tammo van Lessen <tv...@gmail.com>.
Thanks, Sathwik!

@Andres: Deleting old files is not an option, since there may be still
instances of the old version running when a new version is deployed.

On Mon, Mar 19, 2012 at 12:23, Sathwik <ba...@intalio.com> wrote:
> Hi,
>
> JIRA raised and attached the patch as well.
> https://issues.apache.org/jira/browse/ODE-958
>
> regards,
> sathwik
>
>
> On Monday 19 March 2012 01:06 PM, Sathwik wrote:
>>
>> Hi,
>>
>> I came across this problem while using the Intalio server. I think this
>> problem exists in ODE as well.
>>
>> Though I don't how to test this with a testcase, any idea?
>>
>> Steps to reproduce:
>> 1) Deploy a process to the server (V1)
>> 2) Deploy the process again (V2)
>> 3) V1: Retired and V2: Active
>> 4) Now activate (Process package)  V1 which is in Retired state.
>> 5) An exception is thrown ContextException("Can't activate two processes
>> of the same name:....)
>> 6) Now check the status of V1 and V2, you can see that both the versions
>> V1 and V2 are Active.
>>
>> Upon Analysis of the code this is what I found:
>> org.apache.ode.store.ProcessStoreImpl.setState(QName, ProcessState)
>> a) Update the state of the process in database (this call runs in a
>> transaction and gets committed upon success)
>> b) Fire state change event
>>
>> The event fired in (b) is handled in
>> org.apache.ode.axis2.ODEServer.handleEvent(ProcessStoreEvent) which then
>> lands up in the below method
>> org.apache.ode.bpel.engine.BpelEngineImpl.registerProcess(BpelProcess). The
>> below code snippet finally creates the exception.
>>
>> if (cachedVersion.getConf().getState() == ProcessState.ACTIVE
>> && process.getConf().getState() == ProcessState.ACTIVE
>> && !OdeGlobalConfig.autoRetireProcess()) {
>>    throw new ContextException("Can't activate two processes of the same
>> name: " + process.getConf().getPackage() + ", " +
>> cachedVersion.getConf().getPackage() + ", name: " +
>> process.getProcessType());
>> }
>>
>> The problem is now since in (a) the state is already updated and committed
>> and (b) is throwing an runtime exception, but this has no effect and hence
>> the stated problem.
>>
>> regards,
>> sathwik
>
>



-- 
Tammo van Lessen - http://www.taval.de

Re: Serious bug-ODE allows activating a retired process when there is already an active version

Posted by Tammo van Lessen <tv...@gmail.com>.
Thanks, Sathwik!

@Andres: Deleting old files is not an option, since there may be still
instances of the old version running when a new version is deployed.

On Mon, Mar 19, 2012 at 12:23, Sathwik <ba...@intalio.com> wrote:
> Hi,
>
> JIRA raised and attached the patch as well.
> https://issues.apache.org/jira/browse/ODE-958
>
> regards,
> sathwik
>
>
> On Monday 19 March 2012 01:06 PM, Sathwik wrote:
>>
>> Hi,
>>
>> I came across this problem while using the Intalio server. I think this
>> problem exists in ODE as well.
>>
>> Though I don't how to test this with a testcase, any idea?
>>
>> Steps to reproduce:
>> 1) Deploy a process to the server (V1)
>> 2) Deploy the process again (V2)
>> 3) V1: Retired and V2: Active
>> 4) Now activate (Process package)  V1 which is in Retired state.
>> 5) An exception is thrown ContextException("Can't activate two processes
>> of the same name:....)
>> 6) Now check the status of V1 and V2, you can see that both the versions
>> V1 and V2 are Active.
>>
>> Upon Analysis of the code this is what I found:
>> org.apache.ode.store.ProcessStoreImpl.setState(QName, ProcessState)
>> a) Update the state of the process in database (this call runs in a
>> transaction and gets committed upon success)
>> b) Fire state change event
>>
>> The event fired in (b) is handled in
>> org.apache.ode.axis2.ODEServer.handleEvent(ProcessStoreEvent) which then
>> lands up in the below method
>> org.apache.ode.bpel.engine.BpelEngineImpl.registerProcess(BpelProcess). The
>> below code snippet finally creates the exception.
>>
>> if (cachedVersion.getConf().getState() == ProcessState.ACTIVE
>> && process.getConf().getState() == ProcessState.ACTIVE
>> && !OdeGlobalConfig.autoRetireProcess()) {
>>    throw new ContextException("Can't activate two processes of the same
>> name: " + process.getConf().getPackage() + ", " +
>> cachedVersion.getConf().getPackage() + ", name: " +
>> process.getProcessType());
>> }
>>
>> The problem is now since in (a) the state is already updated and committed
>> and (b) is throwing an runtime exception, but this has no effect and hence
>> the stated problem.
>>
>> regards,
>> sathwik
>
>



-- 
Tammo van Lessen - http://www.taval.de

Re: Serious bug-ODE allows activating a retired process when there is already an active version

Posted by Sathwik <ba...@intalio.com>.
Hi,

JIRA raised and attached the patch as well.
https://issues.apache.org/jira/browse/ODE-958

regards,
sathwik

On Monday 19 March 2012 01:06 PM, Sathwik wrote:
> Hi,
>
> I came across this problem while using the Intalio server. I think 
> this problem exists in ODE as well.
>
> Though I don't how to test this with a testcase, any idea?
>
> Steps to reproduce:
> 1) Deploy a process to the server (V1)
> 2) Deploy the process again (V2)
> 3) V1: Retired and V2: Active
> 4) Now activate (Process package)  V1 which is in Retired state.
> 5) An exception is thrown ContextException("Can't activate two 
> processes of the same name:....)
> 6) Now check the status of V1 and V2, you can see that both the 
> versions V1 and V2 are Active.
>
> Upon Analysis of the code this is what I found:
> org.apache.ode.store.ProcessStoreImpl.setState(QName, ProcessState)
> a) Update the state of the process in database (this call runs in a 
> transaction and gets committed upon success)
> b) Fire state change event
>
> The event fired in (b) is handled in 
> org.apache.ode.axis2.ODEServer.handleEvent(ProcessStoreEvent) which 
> then lands up in the below method 
> org.apache.ode.bpel.engine.BpelEngineImpl.registerProcess(BpelProcess). The 
> below code snippet finally creates the exception.
>
> if (cachedVersion.getConf().getState() == ProcessState.ACTIVE
> && process.getConf().getState() == ProcessState.ACTIVE
> && !OdeGlobalConfig.autoRetireProcess()) {
>     throw new ContextException("Can't activate two processes of the 
> same name: " + process.getConf().getPackage() + ", " + 
> cachedVersion.getConf().getPackage() + ", name: " + 
> process.getProcessType());
> }
>
> The problem is now since in (a) the state is already updated and 
> committed and (b) is throwing an runtime exception, but this has no 
> effect and hence the stated problem.
>
> regards,
> sathwik


Re: Serious bug-ODE allows activating a retired process when there is already an active version

Posted by Sathwik <ba...@intalio.com>.
Hi,

JIRA raised and attached the patch as well.
https://issues.apache.org/jira/browse/ODE-958

regards,
sathwik

On Monday 19 March 2012 01:06 PM, Sathwik wrote:
> Hi,
>
> I came across this problem while using the Intalio server. I think 
> this problem exists in ODE as well.
>
> Though I don't how to test this with a testcase, any idea?
>
> Steps to reproduce:
> 1) Deploy a process to the server (V1)
> 2) Deploy the process again (V2)
> 3) V1: Retired and V2: Active
> 4) Now activate (Process package)  V1 which is in Retired state.
> 5) An exception is thrown ContextException("Can't activate two 
> processes of the same name:....)
> 6) Now check the status of V1 and V2, you can see that both the 
> versions V1 and V2 are Active.
>
> Upon Analysis of the code this is what I found:
> org.apache.ode.store.ProcessStoreImpl.setState(QName, ProcessState)
> a) Update the state of the process in database (this call runs in a 
> transaction and gets committed upon success)
> b) Fire state change event
>
> The event fired in (b) is handled in 
> org.apache.ode.axis2.ODEServer.handleEvent(ProcessStoreEvent) which 
> then lands up in the below method 
> org.apache.ode.bpel.engine.BpelEngineImpl.registerProcess(BpelProcess). The 
> below code snippet finally creates the exception.
>
> if (cachedVersion.getConf().getState() == ProcessState.ACTIVE
> && process.getConf().getState() == ProcessState.ACTIVE
> && !OdeGlobalConfig.autoRetireProcess()) {
>     throw new ContextException("Can't activate two processes of the 
> same name: " + process.getConf().getPackage() + ", " + 
> cachedVersion.getConf().getPackage() + ", name: " + 
> process.getProcessType());
> }
>
> The problem is now since in (a) the state is already updated and 
> committed and (b) is throwing an runtime exception, but this has no 
> effect and hence the stated problem.
>
> regards,
> sathwik


Re: Serious bug-ODE allows activating a retired process when there is already an active version

Posted by Andes <yl...@163.com>.
I think it better to delete the older files first, in order not to encounter so many problems...good luck

2012-03-19



Best Regards
Andes



发件人:Sathwik
发送时间:2012-03-19 15:37
主题:Serious bug-ODE allows activating a retired process when there is already an active version
收件人:"dev"<de...@ode.apache.org>
抄送:

Hi, 

I came across this problem while using the Intalio server. I think this  
problem exists in ODE as well. 

Though I don't how to test this with a testcase, any idea? 

Steps to reproduce: 
1) Deploy a process to the server (V1) 
2) Deploy the process again (V2) 
3) V1: Retired and V2: Active 
4) Now activate (Process package)  V1 which is in Retired state. 
5) An exception is thrown ContextException("Can't activate two processes  
of the same name:....) 
6) Now check the status of V1 and V2, you can see that both the versions  
V1 and V2 are Active. 

Upon Analysis of the code this is what I found: 
org.apache.ode.store.ProcessStoreImpl.setState(QName, ProcessState) 
a) Update the state of the process in database (this call runs in a  
transaction and gets committed upon success) 
b) Fire state change event 

The event fired in (b) is handled in  
org.apache.ode.axis2.ODEServer.handleEvent(ProcessStoreEvent) which then  
lands up in the below method  
org.apache.ode.bpel.engine.BpelEngineImpl.registerProcess(BpelProcess).  
The below code snippet finally creates the exception. 

if (cachedVersion.getConf().getState() == ProcessState.ACTIVE 
&& process.getConf().getState() == ProcessState.ACTIVE 
&& !OdeGlobalConfig.autoRetireProcess()) { 
     throw new ContextException("Can't activate two processes of the  
same name: " + process.getConf().getPackage() + ", " +  
cachedVersion.getConf().getPackage() + ", name: " +  
process.getProcessType()); 
} 

The problem is now since in (a) the state is already updated and  
committed and (b) is throwing an runtime exception, but this has no  
effect and hence the stated problem. 

regards, 
sathwik