You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@stratos.apache.org by Akila Ravihansa Perera <ra...@wso2.com> on 2015/10/06 09:01:39 UTC

NPE while executing Drool methods - Integration tests are failing

Hi Thanuja,

I noticed that integration tests are failing in stratos-4.1.x branch due to
an issue in Drools files. It seems there have been couple of modifications
done for Drools files with new metering dashboard feature. Perhaps it is
incompatible with autoscaler APIs. Could you look into that please?

Thanks.

-- 
Akila Ravihansa Perera
WSO2 Inc.;  http://wso2.com/

Blog: http://ravihansa3000.blogspot.com

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Thanuja Uruththirakodeeswaran <th...@wso2.com>.
Hi Akila,

I've checked the integration test results several time.

1. If we do a complete product build I'm getting NullPointerException as
follow:

 - Exception in thread "pool-39-thread-32" Exception in thread
"pool-39-thread-33" java.lang.RuntimeException: cannot invoke method:
getLoadThresholds
 - at
org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:63)
 - at
org.mvel2.optimizers.impl.refl.nodes.VariableAccessor.getValue(VariableAccessor.java:37)
 - at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
 - at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
 - at
org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
 - at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
 - at org.mvel2.MVEL.executeExpression(MVEL.java:942)
 - at
org.drools.base.dataproviders.MVELDataProvider.getResults(MVELDataProvider.java:111)
 - at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:150)
 - at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
 - at
org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:145)
 - at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:154)
 - at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
 - at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
 - at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
 - at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
 - at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
 - at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
 - at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
 - at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
 - at
org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor.evaluate(ClusterMonitor.java:454)
 - at
org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor.access$100(ClusterMonitor.java:83)
 - at
org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor$1.run(ClusterMonitor.java:388)
 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 - at java.lang.Thread.run(Thread.java:745)
 - Caused by: java.lang.NullPointerException
 - at sun.reflect.GeneratedMethodAccessor299.invoke(Unknown Source)
 - at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 - at java.lang.reflect.Method.invoke(Method.java:606)
 - at
org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:48)
 - ... 25 more
 - java.lang.RuntimeException: cannot invoke method: getLoadThresholds
 - at
org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:63)
 - at
org.mvel2.optimizers.impl.refl.nodes.VariableAccessor.getValue(VariableAccessor.java:37)
 - at org.mvel2.ast.ASTNode.getReducedValueAccelerated(ASTNode.java:108)
 - at org.mvel2.MVELRuntime.execute(MVELRuntime.java:85)
 - at
org.mvel2.compiler.CompiledExpression.getDirectValue(CompiledExpression.java:123)
 - at
org.mvel2.compiler.CompiledExpression.getValue(CompiledExpression.java:119)
 - at org.mvel2.MVEL.executeExpression(MVEL.java:942)
 - at
org.drools.base.dataproviders.MVELDataProvider.getResults(MVELDataProvider.java:111)
 - at org.drools.reteoo.FromNode.assertLeftTuple(FromNode.java:150)
 - at
org.drools.reteoo.SingleLeftTupleSinkAdapter.doPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:196)
 - at
org.drools.reteoo.SingleLeftTupleSinkAdapter.createAndPropagateAssertLeftTuple(SingleLeftTupleSinkAdapter.java:145)
 - at
org.drools.reteoo.LeftInputAdapterNode.assertObject(LeftInputAdapterNode.java:154)
 - at
org.drools.reteoo.SingleObjectSinkAdapter.propagateAssertObject(SingleObjectSinkAdapter.java:59)
 - at org.drools.reteoo.ObjectTypeNode.assertObject(ObjectTypeNode.java:235)
 - at org.drools.reteoo.EntryPointNode.assertObject(EntryPointNode.java:240)
 - at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:350)
 - at org.drools.common.NamedEntryPoint.insert(NamedEntryPoint.java:311)
 - at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:903)
 - at
org.drools.common.AbstractWorkingMemory.insert(AbstractWorkingMemory.java:847)
 - at
org.drools.impl.StatefulKnowledgeSessionImpl.insert(StatefulKnowledgeSessionImpl.java:269)
 - at
org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor.evaluate(ClusterMonitor.java:454)
 - at
org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor.access$100(ClusterMonitor.java:83)
 - at
org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor$1.run(ClusterMonitor.java:388)
 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 - at java.lang.Thread.run(Thread.java:745)
 - Caused by: java.lang.NullPointerException
 - at sun.reflect.GeneratedMethodAccessor299.invoke(Unknown Source)
 - at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 - at java.lang.reflect.Method.invoke(Method.java:606)
 - at
org.mvel2.optimizers.impl.refl.nodes.MethodAccessor.getValue(MethodAccessor.java:48)
 - ... 25 more

2. If I ran only the integartion test only I'm getting the following NPE
exception repeatedly:

INFO
 {org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase}:154
- Waiting for application status to become ACTIVE...
 - Exception in thread "pool-39-thread-24" java.lang.NullPointerException
 - at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 - at java.lang.Thread.run(Thread.java:745)
 - Exception in thread "pool-39-thread-27" java.lang.NullPointerException
 - at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 - at java.lang.Thread.run(Thread.java:745)
 - Exception in thread "pool-39-thread-26" java.lang.NullPointerException
 - at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 - at java.lang.Thread.run(Thread.java:745)
 - Exception in thread "pool-39-thread-19" java.lang.NullPointerException
 - at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 - at java.lang.Thread.run(Thread.java:745)
 - Exception in thread "pool-39-thread-30" java.lang.NullPointerException
 - at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 - at java.lang.Thread.run(Thread.java:745)

I've attached the complete log for 1 and 2 here. Also I did a smoke test
for SingleClusterScalingTestCase and it ran successfully without errors.

Currently I'm debugging the integration test.

Thanks.

On Tue, Oct 6, 2015 at 12:38 PM, Thanuja Uruththirakodeeswaran <
thanujau@wso2.com> wrote:

> Hi Akila,
>
> I'll check this and let you know.
>
> Thanks.
>
> On Tue, Oct 6, 2015 at 12:31 PM, Akila Ravihansa Perera <
> ravihansa@wso2.com> wrote:
>
>> Hi Thanuja,
>>
>> I noticed that integration tests are failing in stratos-4.1.x branch due
>> to an issue in Drools files. It seems there have been couple of
>> modifications done for Drools files with new metering dashboard feature.
>> Perhaps it is incompatible with autoscaler APIs. Could you look into that
>> please?
>>
>> Thanks.
>>
>> --
>> Akila Ravihansa Perera
>> WSO2 Inc.;  http://wso2.com/
>>
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
> Thanuja Uruththirakodeeswaran
> Software Engineer
> WSO2 Inc.;http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 774363167
>



-- 
Thanuja Uruththirakodeeswaran
Software Engineer
WSO2 Inc.;http://wso2.com
lean.enterprise.middleware

mobile: +94 774363167

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Gayan Gunarathne <ga...@wso2.com>.
It is like this. That's happened due to nested group with several
members.That's application deployment and un-deployement happen without of
a considerable wait time.

So if we have duplicate MemberActivateEvent , it can be triggered in any
occasion during the life cycle of the application. So if the
MemberActivateEvent event triggered in those sort of case,we can have a NPE
for the members.

Also this may not cause any issue with the single application deployment.
But with several deployment and un-deployments.

Thanks,
Gayan

On Tue, Oct 13, 2015 at 12:02 AM, Akila Ravihansa Perera <ravihansa@wso2.com
> wrote:

> Hi Gayan,
>
> What additional threads? And where do they get created?
>
> Clearly, it should not be published twice, but I still don't understand
> what exactly goes wrong if it is published again.
>
> Thanks.
>
> On Mon, Oct 12, 2015 at 11:51 PM, Gayan Gunarathne <ga...@wso2.com>
> wrote:
>
>>
>> On Mon, Oct 12, 2015 at 9:59 PM, Akila Ravihansa Perera <
>> ravihansa@wso2.com> wrote:
>>
>>> Hi Thanuja,
>>>
>>> Thanks for the update. It seems Stratos Jenkins build has returned to
>>> normal with your last commit [1]. So could this duplicate call to sendMemberActivatedEvent()
>>> method have been the culprit all this time?
>>>
>>
>> We don't need to send the MemberActivatedEvent twice. Seems it leads to
>> create additional threads and those threads leads to this build failure.
>>
>>>
>>> @Reka: Autoscaler is listening to MemberActivated event and executing
>>> this logic at [2] for each event. Will it cause an issue if it is executed
>>> multiple times? I cannot think of any other place it could have caused any
>>> issue. Even TopologyHandler class used by integration tests do not listen
>>> to this event.
>>>
>>> [1] https://builds.apache.org/job/Stratos-41x-Commit-Build/87/
>>> [2]
>>> https://github.com/apache/stratos/blob/stratos-4.1.x/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusProcessorChain.java#L49
>>>
>>> Thanks.
>>>
>>>
>>> On Mon, Oct 12, 2015 at 9:28 PM, Thanuja Uruththirakodeeswaran <
>>> thanujau@wso2.com> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I did several builds with latest changes. Each local build triggered
>>>> successfully with no test failures. But there are RuntimeExceptions.
>>>> I tried following scenarios
>>>> 1. Reverted metering service changes as in commit [1] - build success
>>>> 2. Build stratos 4.1.x branch with latest commit [2] - build success
>>>> 3. Build stratos 4.1.x branch without latest commit [2] - tests failed
>>>>
>>>> For the 3rd scenario, I got test failures as below and I've attached
>>>> part of test log here:
>>>>
>>>>
>>>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0, Time elapsed:
>>>> 1,499.716 sec <<< FAILURE! - in TestSuite
>>>> testTerminationBehavior(org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase)
>>>>  Time elapsed: 312.479 sec  <<< FAILURE!
>>>> java.lang.AssertionError:
>>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:33)
>>>> at
>>>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.assertCreationOfNodes(GroupStartupOrderTestCase.java:339)
>>>> at
>>>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.testTerminationBehavior(GroupStartupOrderTestCase.java:149)
>>>>
>>>> testApplication(org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase)
>>>>  Time elapsed: 0.351 sec  <<< FAILURE!
>>>> java.lang.AssertionError:
>>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>>> at
>>>> org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase.testApplication(SampleApplicationStartupTestCase.java:105)
>>>>
>>>> testApplicationList(org.apache.stratos.integration.tests.application.SampleApplicationsTestCase)
>>>>  Time elapsed: 1.032 sec  <<< FAILURE!
>>>> java.lang.AssertionError:
>>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>>> at
>>>> org.apache.stratos.integration.tests.application.SampleApplicationsTestCase.testApplicationList(SampleApplicationsTestCase.java:350)
>>>>
>>>> testApplicationBusting(org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase)
>>>>  Time elapsed: 32.926 sec  <<< FAILURE!
>>>> java.lang.AssertionError:
>>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>>> at
>>>> org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase.testApplicationBusting(ApplicationBurstingTestCase.java:138)
>>>>
>>>>
>>>> Results :
>>>>
>>>> Failed tests:
>>>>   ApplicationBurstingTestCase.testApplicationBusting:138
>>>>
>>>> GroupStartupOrderTestCase.testTerminationBehavior:149->assertCreationOfNodes:339
>>>>   SampleApplicationStartupTestCase.testApplication:105
>>>>   SampleApplicationsTestCase.testApplicationList:350
>>>>
>>>>
>>>>
>>>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0
>>>>
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>> [INFO] Reactor Summary:
>>>> [INFO]
>>>> [INFO] Apache Stratos - Integration Aggregation Module ... SUCCESS
>>>> [1.360s]
>>>> [INFO] Apache Stratos - Integration Common Module ........ SUCCESS
>>>> [6.356s]
>>>> [INFO] Apache Stratos - Integration Tests ................ FAILURE
>>>> [25:05.695s]
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>> I continuously ran more integration test on above scenarios and if I
>>>> get any different result, I'll update in this thread.
>>>>
>>>> [1].
>>>> https://github.com/Thanu/stratos/commit/631d1a1cc71ade793a6a6c59edabb34bd1594747
>>>> [2].
>>>> https://github.com/apache/stratos/commit/4bc27f29cb84d86fdaac554ca5a426cb0eb3776f
>>>>
>>>> Thanks.
>>>>
>>>> On Sun, Oct 11, 2015 at 6:29 PM, Gayan Gunarathne <ga...@wso2.com>
>>>> wrote:
>>>>
>>>>> Seems even application is terminated, some of the group monitors are
>>>>> still running. Mostly in the nested group scenario. Those group monitors
>>>>> looking for the application monitor that didn't exist at that time.So I
>>>>> think we need to recheck the logic of group monitor termination logic in
>>>>> the application un-deployment. Will check further on this.
>>>>>
>>>>> 2015-10-11 18:15:07 ERROR
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
>>>>> Exception in thread "pool-39-thread-36" java.lang.NullPointerException
>>>>> 2015-10-11 18:15:07 ERROR
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
>>>>> 2015-10-11 18:15:07 ERROR
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>>> 2015-10-11 18:15:07 ERROR
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>> 2015-10-11 18:15:07 ERROR
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>>> java.lang.Thread.run(Thread.java:744)
>>>>> 2015-10-11 18:15:07 INFO
>>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-11 18:15:07,285] DEBUG
>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>> monitor is running: [group] my-group6-group-startup-order-test
>>>>>
>>>>> Thanks,
>>>>> Gayan
>>>>>
>>>>> On Sat, Oct 10, 2015 at 3:35 PM, Akila Ravihansa Perera <
>>>>> ravihansa@wso2.com> wrote:
>>>>>
>>>>>> This is occurring frequently even in local build. I think this is a
>>>>>> blocker for 4.1.4 release.
>>>>>>
>>>>>> On Fri, Oct 9, 2015 at 9:20 PM, Imesh Gunaratne <im...@apache.org>
>>>>>> wrote:
>>>>>>
>>>>>>> Thanks Reka! It is important to identify the root cause of this
>>>>>>> issue. I'm also looking in.
>>>>>>>
>>>>>>> On Thu, Oct 8, 2015 at 6:13 PM, Reka Thirunavukkarasu <reka@wso2.com
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> After going through the logs of integration, please find the break
>>>>>>>> down as below. For my-group6-group-tom2-group-startup-order-test, it
>>>>>>>> seems that the Adder got triggered twice or somehow monitor creation got
>>>>>>>> triggered twice which cause the memory to inconsistent state. Hence the
>>>>>>>> particular GroupMonitor got removed somehow. So that the application
>>>>>>>> hierarchy was incomplete and application was unable to become active. I'm
>>>>>>>> still investigating on it to find out the root cause.
>>>>>>>>
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>>> Monitor scheduled: [type] cluster [component]
>>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
>>>>>>>> ClusterMonitor task interval set to : [application-id] null [cluster]
>>>>>>>> group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
>>>>>>>> [monitor-interval] 90000
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>>> Starting monitor: [type] cluster [component]
>>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,504] ERROR
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
>>>>>>>> error occurred while starting monitor: [type] group [component]
>>>>>>>> my-group6-group-tom2-group-startup-order-test
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> java.lang.NullPointerException
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at java.lang.Thread.run(Thread.java:745)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>>>> monitor is running: [group] my-group6-group-tom2-group-startup-order-test
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>>> -  Instance expiry time is set to: 900000
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>>> -  Instance obsolete expiry time is set to: 86400000
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>>> -  Instance pending termination expiry time is set to: 1800000
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
>>>>>>>> [Partition] partition-1has been added for the [Group]
>>>>>>>> my-group9-group-startup-order-test
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>>> Monitor started successfully: [type] group [component]
>>>>>>>> my-group6-group-tom2-group-startup-order-test [dependents] none
>>>>>>>> [startup-time] 0 seconds
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>>>> [Instance context] group-startup-order-test-1 has been added to [Group]
>>>>>>>> my-group9-group-startup-order-test
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
>>>>>>>> the dependencies for the [Group] my-group9-group-startup-order-test
>>>>>>>>
>>>>>>>> --------------------------------------
>>>>>>>>
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>>>> -  Checking the status of cluster
>>>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>>>> instance status is: Active
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>>>> -  Checking the status of cluster
>>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>>> instance status is: Active
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>>> Write lock released
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
>>>>>>>> -  Sending group instance active for [group]
>>>>>>>> my-group6-group-tom2-group-startup-order-test [instance]
>>>>>>>> group-startup-order-test-1
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>>>> Handling group activation for the [group-id]:
>>>>>>>> my-group6-group-tom2-group-startup-order-test in the [application-id]
>>>>>>>> group-startup-order-test [instance] group-startup-order-test-1
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>>> Write lock acquired
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100]  WARN
>>>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>>>> Group monitor cannot be found: [group-id]
>>>>>>>> my-group6-group-tom2-group-startup-order-test [application-id]
>>>>>>>> group-startup-order-test
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
>>>>>>>> Cluster activated adding status started for
>>>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>>> Updating topology
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Reka
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <
>>>>>>>> reka@wso2.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Akila
>>>>>>>>>
>>>>>>>>> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <
>>>>>>>>> ravihansa@wso2.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Thanuja,
>>>>>>>>>>
>>>>>>>>>> I was referring to the build fail in [1]. Please see line
>>>>>>>>>> starting from:
>>>>>>>>>>
>>>>>>>>>> 2015-10-02 07:28:32 INFO
>>>>>>>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>>> [2015-10-02 07:28:32,834] ERROR
>>>>>>>>>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>>>>>>>>>> instance
>>>>>>>>>>
>>>>>>>>>> I think this is a separate issue that occurs very rarely. As you
>>>>>>>>>> noticed, NPE in GroupMonitor occurs when undeploying applications. The
>>>>>>>>>> problem is group monitors are retrieving the status from other group
>>>>>>>>>> monitor objects.
>>>>>>>>>>
>>>>>>>>>> @Reka: shall we change that logic to read the application status
>>>>>>>>>> from topology or ApplicationHolder instead of reading from monitors?
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> We can't read the Application status from Topology as Application
>>>>>>>>> will not contain any status rather only application instance will contain
>>>>>>>>> the status. By accessing application instance, we can't identify whether
>>>>>>>>> undeployment or force undeployment is in-progress. Hence we will have to
>>>>>>>>> maintain these flags to ApplicationMonitor to identity the undeployment or
>>>>>>>>> force undeployment. All other status are actually referring from the
>>>>>>>>> Topology.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Reka
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> [1]
>>>>>>>>>> https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>>>>>>>>>
>>>>>>>>>> Thanks.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Reka Thirunavukkarasu
>>>>>>>>> Senior Software Engineer,
>>>>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>>>>> Mobile: +94776442007
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Reka Thirunavukkarasu
>>>>>>>> Senior Software Engineer,
>>>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>>>> Mobile: +94776442007
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Imesh Gunaratne
>>>>>>>
>>>>>>> Senior Technical Lead, WSO2
>>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Akila Ravihansa Perera
>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>
>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Gayan Gunarathne
>>>>> Technical Lead, WSO2 Inc. (http://wso2.com)
>>>>> Committer & PMC Member, Apache Stratos
>>>>> email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thanuja Uruththirakodeeswaran
>>>> Software Engineer
>>>> WSO2 Inc.;http://wso2.com
>>>> lean.enterprise.middleware
>>>>
>>>> mobile: +94 774363167
>>>>
>>>
>>>
>>>
>>> --
>>> Akila Ravihansa Perera
>>> WSO2 Inc.;  http://wso2.com/
>>>
>>> Blog: http://ravihansa3000.blogspot.com
>>>
>>
>>
>>
>> --
>>
>> Gayan Gunarathne
>> Technical Lead, WSO2 Inc. (http://wso2.com)
>> Committer & PMC Member, Apache Stratos
>> email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>
>>
>>
>>
>
>
>
> --
> Akila Ravihansa Perera
> WSO2 Inc.;  http://wso2.com/
>
> Blog: http://ravihansa3000.blogspot.com
>



-- 

Gayan Gunarathne
Technical Lead, WSO2 Inc. (http://wso2.com)
Committer & PMC Member, Apache Stratos
email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
Hi Gayan,

What additional threads? And where do they get created?

Clearly, it should not be published twice, but I still don't understand
what exactly goes wrong if it is published again.

Thanks.

On Mon, Oct 12, 2015 at 11:51 PM, Gayan Gunarathne <ga...@wso2.com> wrote:

>
> On Mon, Oct 12, 2015 at 9:59 PM, Akila Ravihansa Perera <
> ravihansa@wso2.com> wrote:
>
>> Hi Thanuja,
>>
>> Thanks for the update. It seems Stratos Jenkins build has returned to
>> normal with your last commit [1]. So could this duplicate call to sendMemberActivatedEvent()
>> method have been the culprit all this time?
>>
>
> We don't need to send the MemberActivatedEvent twice. Seems it leads to
> create additional threads and those threads leads to this build failure.
>
>>
>> @Reka: Autoscaler is listening to MemberActivated event and executing
>> this logic at [2] for each event. Will it cause an issue if it is executed
>> multiple times? I cannot think of any other place it could have caused any
>> issue. Even TopologyHandler class used by integration tests do not listen
>> to this event.
>>
>> [1] https://builds.apache.org/job/Stratos-41x-Commit-Build/87/
>> [2]
>> https://github.com/apache/stratos/blob/stratos-4.1.x/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusProcessorChain.java#L49
>>
>> Thanks.
>>
>>
>> On Mon, Oct 12, 2015 at 9:28 PM, Thanuja Uruththirakodeeswaran <
>> thanujau@wso2.com> wrote:
>>
>>> Hi All,
>>>
>>> I did several builds with latest changes. Each local build triggered
>>> successfully with no test failures. But there are RuntimeExceptions.
>>> I tried following scenarios
>>> 1. Reverted metering service changes as in commit [1] - build success
>>> 2. Build stratos 4.1.x branch with latest commit [2] - build success
>>> 3. Build stratos 4.1.x branch without latest commit [2] - tests failed
>>>
>>> For the 3rd scenario, I got test failures as below and I've attached
>>> part of test log here:
>>>
>>>
>>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0, Time elapsed:
>>> 1,499.716 sec <<< FAILURE! - in TestSuite
>>> testTerminationBehavior(org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase)
>>>  Time elapsed: 312.479 sec  <<< FAILURE!
>>> java.lang.AssertionError:
>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:33)
>>> at
>>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.assertCreationOfNodes(GroupStartupOrderTestCase.java:339)
>>> at
>>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.testTerminationBehavior(GroupStartupOrderTestCase.java:149)
>>>
>>> testApplication(org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase)
>>>  Time elapsed: 0.351 sec  <<< FAILURE!
>>> java.lang.AssertionError:
>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>> at
>>> org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase.testApplication(SampleApplicationStartupTestCase.java:105)
>>>
>>> testApplicationList(org.apache.stratos.integration.tests.application.SampleApplicationsTestCase)
>>>  Time elapsed: 1.032 sec  <<< FAILURE!
>>> java.lang.AssertionError:
>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>> at
>>> org.apache.stratos.integration.tests.application.SampleApplicationsTestCase.testApplicationList(SampleApplicationsTestCase.java:350)
>>>
>>> testApplicationBusting(org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase)
>>>  Time elapsed: 32.926 sec  <<< FAILURE!
>>> java.lang.AssertionError:
>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>> at
>>> org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase.testApplicationBusting(ApplicationBurstingTestCase.java:138)
>>>
>>>
>>> Results :
>>>
>>> Failed tests:
>>>   ApplicationBurstingTestCase.testApplicationBusting:138
>>>
>>> GroupStartupOrderTestCase.testTerminationBehavior:149->assertCreationOfNodes:339
>>>   SampleApplicationStartupTestCase.testApplication:105
>>>   SampleApplicationsTestCase.testApplicationList:350
>>>
>>>
>>>
>>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0
>>>
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] Reactor Summary:
>>> [INFO]
>>> [INFO] Apache Stratos - Integration Aggregation Module ... SUCCESS
>>> [1.360s]
>>> [INFO] Apache Stratos - Integration Common Module ........ SUCCESS
>>> [6.356s]
>>> [INFO] Apache Stratos - Integration Tests ................ FAILURE
>>> [25:05.695s]
>>> [INFO]
>>> ------------------------------------------------------------------------
>>>
>>> I continuously ran more integration test on above scenarios and if I get
>>> any different result, I'll update in this thread.
>>>
>>> [1].
>>> https://github.com/Thanu/stratos/commit/631d1a1cc71ade793a6a6c59edabb34bd1594747
>>> [2].
>>> https://github.com/apache/stratos/commit/4bc27f29cb84d86fdaac554ca5a426cb0eb3776f
>>>
>>> Thanks.
>>>
>>> On Sun, Oct 11, 2015 at 6:29 PM, Gayan Gunarathne <ga...@wso2.com>
>>> wrote:
>>>
>>>> Seems even application is terminated, some of the group monitors are
>>>> still running. Mostly in the nested group scenario. Those group monitors
>>>> looking for the application monitor that didn't exist at that time.So I
>>>> think we need to recheck the logic of group monitor termination logic in
>>>> the application un-deployment. Will check further on this.
>>>>
>>>> 2015-10-11 18:15:07 ERROR
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
>>>> Exception in thread "pool-39-thread-36" java.lang.NullPointerException
>>>> 2015-10-11 18:15:07 ERROR
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
>>>> 2015-10-11 18:15:07 ERROR
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>> 2015-10-11 18:15:07 ERROR
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>> 2015-10-11 18:15:07 ERROR
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>> java.lang.Thread.run(Thread.java:744)
>>>> 2015-10-11 18:15:07 INFO
>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-11 18:15:07,285] DEBUG
>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>> monitor is running: [group] my-group6-group-startup-order-test
>>>>
>>>> Thanks,
>>>> Gayan
>>>>
>>>> On Sat, Oct 10, 2015 at 3:35 PM, Akila Ravihansa Perera <
>>>> ravihansa@wso2.com> wrote:
>>>>
>>>>> This is occurring frequently even in local build. I think this is a
>>>>> blocker for 4.1.4 release.
>>>>>
>>>>> On Fri, Oct 9, 2015 at 9:20 PM, Imesh Gunaratne <im...@apache.org>
>>>>> wrote:
>>>>>
>>>>>> Thanks Reka! It is important to identify the root cause of this
>>>>>> issue. I'm also looking in.
>>>>>>
>>>>>> On Thu, Oct 8, 2015 at 6:13 PM, Reka Thirunavukkarasu <re...@wso2.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> After going through the logs of integration, please find the break
>>>>>>> down as below. For my-group6-group-tom2-group-startup-order-test, it
>>>>>>> seems that the Adder got triggered twice or somehow monitor creation got
>>>>>>> triggered twice which cause the memory to inconsistent state. Hence the
>>>>>>> particular GroupMonitor got removed somehow. So that the application
>>>>>>> hierarchy was incomplete and application was unable to become active. I'm
>>>>>>> still investigating on it to find out the root cause.
>>>>>>>
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>> Monitor scheduled: [type] cluster [component]
>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
>>>>>>> ClusterMonitor task interval set to : [application-id] null [cluster]
>>>>>>> group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
>>>>>>> [monitor-interval] 90000
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>> Starting monitor: [type] cluster [component]
>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,504] ERROR
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
>>>>>>> error occurred while starting monitor: [type] group [component]
>>>>>>> my-group6-group-tom2-group-startup-order-test
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> java.lang.NullPointerException
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at java.lang.Thread.run(Thread.java:745)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>>> monitor is running: [group] my-group6-group-tom2-group-startup-order-test
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>> -  Instance expiry time is set to: 900000
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>> -  Instance obsolete expiry time is set to: 86400000
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>> -  Instance pending termination expiry time is set to: 1800000
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
>>>>>>> [Partition] partition-1has been added for the [Group]
>>>>>>> my-group9-group-startup-order-test
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>> Monitor started successfully: [type] group [component]
>>>>>>> my-group6-group-tom2-group-startup-order-test [dependents] none
>>>>>>> [startup-time] 0 seconds
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>>> [Instance context] group-startup-order-test-1 has been added to [Group]
>>>>>>> my-group9-group-startup-order-test
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
>>>>>>> the dependencies for the [Group] my-group9-group-startup-order-test
>>>>>>>
>>>>>>> --------------------------------------
>>>>>>>
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>>> -  Checking the status of cluster
>>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>>> instance status is: Active
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>>> -  Checking the status of cluster
>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>> instance status is: Active
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>> Write lock released
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
>>>>>>> -  Sending group instance active for [group]
>>>>>>> my-group6-group-tom2-group-startup-order-test [instance]
>>>>>>> group-startup-order-test-1
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>>> Handling group activation for the [group-id]:
>>>>>>> my-group6-group-tom2-group-startup-order-test in the [application-id]
>>>>>>> group-startup-order-test [instance] group-startup-order-test-1
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>> Write lock acquired
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100]  WARN
>>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>>> Group monitor cannot be found: [group-id]
>>>>>>> my-group6-group-tom2-group-startup-order-test [application-id]
>>>>>>> group-startup-order-test
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
>>>>>>> Cluster activated adding status started for
>>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>> Updating topology
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Reka
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <reka@wso2.com
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> Hi Akila
>>>>>>>>
>>>>>>>> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <
>>>>>>>> ravihansa@wso2.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Thanuja,
>>>>>>>>>
>>>>>>>>> I was referring to the build fail in [1]. Please see line starting
>>>>>>>>> from:
>>>>>>>>>
>>>>>>>>> 2015-10-02 07:28:32 INFO
>>>>>>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>> [2015-10-02 07:28:32,834] ERROR
>>>>>>>>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>>>>>>>>> instance
>>>>>>>>>
>>>>>>>>> I think this is a separate issue that occurs very rarely. As you
>>>>>>>>> noticed, NPE in GroupMonitor occurs when undeploying applications. The
>>>>>>>>> problem is group monitors are retrieving the status from other group
>>>>>>>>> monitor objects.
>>>>>>>>>
>>>>>>>>> @Reka: shall we change that logic to read the application status
>>>>>>>>> from topology or ApplicationHolder instead of reading from monitors?
>>>>>>>>>
>>>>>>>>
>>>>>>>> We can't read the Application status from Topology as Application
>>>>>>>> will not contain any status rather only application instance will contain
>>>>>>>> the status. By accessing application instance, we can't identify whether
>>>>>>>> undeployment or force undeployment is in-progress. Hence we will have to
>>>>>>>> maintain these flags to ApplicationMonitor to identity the undeployment or
>>>>>>>> force undeployment. All other status are actually referring from the
>>>>>>>> Topology.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Reka
>>>>>>>>
>>>>>>>>>
>>>>>>>>> [1]
>>>>>>>>> https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Reka Thirunavukkarasu
>>>>>>>> Senior Software Engineer,
>>>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>>>> Mobile: +94776442007
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Reka Thirunavukkarasu
>>>>>>> Senior Software Engineer,
>>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>>> Mobile: +94776442007
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Senior Technical Lead, WSO2
>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Akila Ravihansa Perera
>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>
>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Gayan Gunarathne
>>>> Technical Lead, WSO2 Inc. (http://wso2.com)
>>>> Committer & PMC Member, Apache Stratos
>>>> email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Thanuja Uruththirakodeeswaran
>>> Software Engineer
>>> WSO2 Inc.;http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: +94 774363167
>>>
>>
>>
>>
>> --
>> Akila Ravihansa Perera
>> WSO2 Inc.;  http://wso2.com/
>>
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
>
> Gayan Gunarathne
> Technical Lead, WSO2 Inc. (http://wso2.com)
> Committer & PMC Member, Apache Stratos
> email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>
>
>
>



-- 
Akila Ravihansa Perera
WSO2 Inc.;  http://wso2.com/

Blog: http://ravihansa3000.blogspot.com

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Gayan Gunarathne <ga...@wso2.com>.
On Mon, Oct 12, 2015 at 9:59 PM, Akila Ravihansa Perera <ra...@wso2.com>
wrote:

> Hi Thanuja,
>
> Thanks for the update. It seems Stratos Jenkins build has returned to
> normal with your last commit [1]. So could this duplicate call to sendMemberActivatedEvent()
> method have been the culprit all this time?
>

We don't need to send the MemberActivatedEvent twice. Seems it leads to
create additional threads and those threads leads to this build failure.

>
> @Reka: Autoscaler is listening to MemberActivated event and executing this
> logic at [2] for each event. Will it cause an issue if it is executed
> multiple times? I cannot think of any other place it could have caused any
> issue. Even TopologyHandler class used by integration tests do not listen
> to this event.
>
> [1] https://builds.apache.org/job/Stratos-41x-Commit-Build/87/
> [2]
> https://github.com/apache/stratos/blob/stratos-4.1.x/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusProcessorChain.java#L49
>
> Thanks.
>
>
> On Mon, Oct 12, 2015 at 9:28 PM, Thanuja Uruththirakodeeswaran <
> thanujau@wso2.com> wrote:
>
>> Hi All,
>>
>> I did several builds with latest changes. Each local build triggered
>> successfully with no test failures. But there are RuntimeExceptions.
>> I tried following scenarios
>> 1. Reverted metering service changes as in commit [1] - build success
>> 2. Build stratos 4.1.x branch with latest commit [2] - build success
>> 3. Build stratos 4.1.x branch without latest commit [2] - tests failed
>>
>> For the 3rd scenario, I got test failures as below and I've attached part
>> of test log here:
>>
>>
>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0, Time elapsed:
>> 1,499.716 sec <<< FAILURE! - in TestSuite
>> testTerminationBehavior(org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase)
>>  Time elapsed: 312.479 sec  <<< FAILURE!
>> java.lang.AssertionError:
>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:33)
>> at
>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.assertCreationOfNodes(GroupStartupOrderTestCase.java:339)
>> at
>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.testTerminationBehavior(GroupStartupOrderTestCase.java:149)
>>
>> testApplication(org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase)
>>  Time elapsed: 0.351 sec  <<< FAILURE!
>> java.lang.AssertionError:
>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>> at
>> org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase.testApplication(SampleApplicationStartupTestCase.java:105)
>>
>> testApplicationList(org.apache.stratos.integration.tests.application.SampleApplicationsTestCase)
>>  Time elapsed: 1.032 sec  <<< FAILURE!
>> java.lang.AssertionError:
>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>> at
>> org.apache.stratos.integration.tests.application.SampleApplicationsTestCase.testApplicationList(SampleApplicationsTestCase.java:350)
>>
>> testApplicationBusting(org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase)
>>  Time elapsed: 32.926 sec  <<< FAILURE!
>> java.lang.AssertionError:
>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>> at
>> org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase.testApplicationBusting(ApplicationBurstingTestCase.java:138)
>>
>>
>> Results :
>>
>> Failed tests:
>>   ApplicationBurstingTestCase.testApplicationBusting:138
>>
>> GroupStartupOrderTestCase.testTerminationBehavior:149->assertCreationOfNodes:339
>>   SampleApplicationStartupTestCase.testApplication:105
>>   SampleApplicationsTestCase.testApplicationList:350
>>
>>
>>
>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Reactor Summary:
>> [INFO]
>> [INFO] Apache Stratos - Integration Aggregation Module ... SUCCESS
>> [1.360s]
>> [INFO] Apache Stratos - Integration Common Module ........ SUCCESS
>> [6.356s]
>> [INFO] Apache Stratos - Integration Tests ................ FAILURE
>> [25:05.695s]
>> [INFO]
>> ------------------------------------------------------------------------
>>
>> I continuously ran more integration test on above scenarios and if I get
>> any different result, I'll update in this thread.
>>
>> [1].
>> https://github.com/Thanu/stratos/commit/631d1a1cc71ade793a6a6c59edabb34bd1594747
>> [2].
>> https://github.com/apache/stratos/commit/4bc27f29cb84d86fdaac554ca5a426cb0eb3776f
>>
>> Thanks.
>>
>> On Sun, Oct 11, 2015 at 6:29 PM, Gayan Gunarathne <ga...@wso2.com>
>> wrote:
>>
>>> Seems even application is terminated, some of the group monitors are
>>> still running. Mostly in the nested group scenario. Those group monitors
>>> looking for the application monitor that didn't exist at that time.So I
>>> think we need to recheck the logic of group monitor termination logic in
>>> the application un-deployment. Will check further on this.
>>>
>>> 2015-10-11 18:15:07 ERROR
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
>>> Exception in thread "pool-39-thread-36" java.lang.NullPointerException
>>> 2015-10-11 18:15:07 ERROR
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
>>> 2015-10-11 18:15:07 ERROR
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>> 2015-10-11 18:15:07 ERROR
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>> 2015-10-11 18:15:07 ERROR
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>> java.lang.Thread.run(Thread.java:744)
>>> 2015-10-11 18:15:07 INFO
>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-11 18:15:07,285] DEBUG
>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>> monitor is running: [group] my-group6-group-startup-order-test
>>>
>>> Thanks,
>>> Gayan
>>>
>>> On Sat, Oct 10, 2015 at 3:35 PM, Akila Ravihansa Perera <
>>> ravihansa@wso2.com> wrote:
>>>
>>>> This is occurring frequently even in local build. I think this is a
>>>> blocker for 4.1.4 release.
>>>>
>>>> On Fri, Oct 9, 2015 at 9:20 PM, Imesh Gunaratne <im...@apache.org>
>>>> wrote:
>>>>
>>>>> Thanks Reka! It is important to identify the root cause of this issue.
>>>>> I'm also looking in.
>>>>>
>>>>> On Thu, Oct 8, 2015 at 6:13 PM, Reka Thirunavukkarasu <re...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> After going through the logs of integration, please find the break
>>>>>> down as below. For my-group6-group-tom2-group-startup-order-test, it
>>>>>> seems that the Adder got triggered twice or somehow monitor creation got
>>>>>> triggered twice which cause the memory to inconsistent state. Hence the
>>>>>> particular GroupMonitor got removed somehow. So that the application
>>>>>> hierarchy was incomplete and application was unable to become active. I'm
>>>>>> still investigating on it to find out the root cause.
>>>>>>
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>> Monitor scheduled: [type] cluster [component]
>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>> {org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
>>>>>> ClusterMonitor task interval set to : [application-id] null [cluster]
>>>>>> group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
>>>>>> [monitor-interval] 90000
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>> Starting monitor: [type] cluster [component]
>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,504] ERROR
>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
>>>>>> error occurred while starting monitor: [type] group [component]
>>>>>> my-group6-group-tom2-group-startup-order-test
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> java.lang.NullPointerException
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at java.lang.Thread.run(Thread.java:745)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>> monitor is running: [group] my-group6-group-tom2-group-startup-order-test
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>> -  Instance expiry time is set to: 900000
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>> -  Instance obsolete expiry time is set to: 86400000
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>> -  Instance pending termination expiry time is set to: 1800000
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
>>>>>> [Partition] partition-1has been added for the [Group]
>>>>>> my-group9-group-startup-order-test
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>> Monitor started successfully: [type] group [component]
>>>>>> my-group6-group-tom2-group-startup-order-test [dependents] none
>>>>>> [startup-time] 0 seconds
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>> [Instance context] group-startup-order-test-1 has been added to [Group]
>>>>>> my-group9-group-startup-order-test
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
>>>>>> the dependencies for the [Group] my-group9-group-startup-order-test
>>>>>>
>>>>>> --------------------------------------
>>>>>>
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>> -  Checking the status of cluster
>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>> instance status is: Active
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>> -  Checking the status of cluster
>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>> instance status is: Active
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>> Write lock released
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
>>>>>> -  Sending group instance active for [group]
>>>>>> my-group6-group-tom2-group-startup-order-test [instance]
>>>>>> group-startup-order-test-1
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>> Handling group activation for the [group-id]:
>>>>>> my-group6-group-tom2-group-startup-order-test in the [application-id]
>>>>>> group-startup-order-test [instance] group-startup-order-test-1
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>> Write lock acquired
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100]  WARN
>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>> Group monitor cannot be found: [group-id]
>>>>>> my-group6-group-tom2-group-startup-order-test [application-id]
>>>>>> group-startup-order-test
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
>>>>>> Cluster activated adding status started for
>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>> Updating topology
>>>>>>
>>>>>> Thanks,
>>>>>> Reka
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <re...@wso2.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Akila
>>>>>>>
>>>>>>> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <
>>>>>>> ravihansa@wso2.com> wrote:
>>>>>>>
>>>>>>>> Hi Thanuja,
>>>>>>>>
>>>>>>>> I was referring to the build fail in [1]. Please see line starting
>>>>>>>> from:
>>>>>>>>
>>>>>>>> 2015-10-02 07:28:32 INFO
>>>>>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-02 07:28:32,834] ERROR
>>>>>>>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>>>>>>>> instance
>>>>>>>>
>>>>>>>> I think this is a separate issue that occurs very rarely. As you
>>>>>>>> noticed, NPE in GroupMonitor occurs when undeploying applications. The
>>>>>>>> problem is group monitors are retrieving the status from other group
>>>>>>>> monitor objects.
>>>>>>>>
>>>>>>>> @Reka: shall we change that logic to read the application status
>>>>>>>> from topology or ApplicationHolder instead of reading from monitors?
>>>>>>>>
>>>>>>>
>>>>>>> We can't read the Application status from Topology as Application
>>>>>>> will not contain any status rather only application instance will contain
>>>>>>> the status. By accessing application instance, we can't identify whether
>>>>>>> undeployment or force undeployment is in-progress. Hence we will have to
>>>>>>> maintain these flags to ApplicationMonitor to identity the undeployment or
>>>>>>> force undeployment. All other status are actually referring from the
>>>>>>> Topology.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Reka
>>>>>>>
>>>>>>>>
>>>>>>>> [1]
>>>>>>>> https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Reka Thirunavukkarasu
>>>>>>> Senior Software Engineer,
>>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>>> Mobile: +94776442007
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Reka Thirunavukkarasu
>>>>>> Senior Software Engineer,
>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>> Mobile: +94776442007
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Imesh Gunaratne
>>>>>
>>>>> Senior Technical Lead, WSO2
>>>>> Committer & PMC Member, Apache Stratos
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Akila Ravihansa Perera
>>>> WSO2 Inc.;  http://wso2.com/
>>>>
>>>> Blog: http://ravihansa3000.blogspot.com
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> Gayan Gunarathne
>>> Technical Lead, WSO2 Inc. (http://wso2.com)
>>> Committer & PMC Member, Apache Stratos
>>> email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Thanuja Uruththirakodeeswaran
>> Software Engineer
>> WSO2 Inc.;http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 774363167
>>
>
>
>
> --
> Akila Ravihansa Perera
> WSO2 Inc.;  http://wso2.com/
>
> Blog: http://ravihansa3000.blogspot.com
>



-- 

Gayan Gunarathne
Technical Lead, WSO2 Inc. (http://wso2.com)
Committer & PMC Member, Apache Stratos
email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Reka Thirunavukkarasu <re...@wso2.com>.
Hi Akila,

Whenever a member status changes, we are calculating the status of the
cluster instance using ClusterStatusProcessorChain where it has processors
for active, terminated, inactive and etc. The first processor which
calculates the status will send the Topology event with cluster status
change. In order to calculate a particular status of the cluster, we are
going through the Autoscaler in-memory model against ClusterInstanceContext
and checking for the active count, minimum count and etc. The approach is
similar for Group Instance status calculation as well. Whenever a Cluster
status changes, then the parent group status will be derived using the
GroupStatusProcessorChain by going through the ApplicationsTopology.

Hope this might to help to clear your doubt.

Thanks,
Reka

On Mon, Oct 12, 2015 at 10:31 PM, Akila Ravihansa Perera <ravihansa@wso2.com
> wrote:

> Hi Reka,
>
> Yes, I meant we don't register any receivers for MemberActivated event in
> TopologyHandler. Could you explain what happens in this piece of code in
> ClusterStatusProcessorChain?
>
> "root.process(type, clusterId, instanceId);"
>
> Thanks.
>
> On Mon, Oct 12, 2015 at 10:19 PM, Reka Thirunavukkarasu <re...@wso2.com>
> wrote:
>
>> Hi Akila/Thanuja,
>>
>> On Mon, Oct 12, 2015 at 9:59 PM, Akila Ravihansa Perera <
>> ravihansa@wso2.com> wrote:
>>
>>> Hi Thanuja,
>>>
>>> Thanks for the update. It seems Stratos Jenkins build has returned to
>>> normal with your last commit [1]. So could this duplicate call to sendMemberActivatedEvent()
>>> method have been the culprit all this time?
>>>
>>> @Reka: Autoscaler is listening to MemberActivated event and executing
>>> this logic at [2] for each event. Will it cause an issue if it is executed
>>> multiple times? I cannot think of any other place it could have caused any
>>> issue. Even TopologyHandler class used by integration tests do not listen
>>> to this event.
>>>
>>
>> TopologyHanlder is already listening to Topology events. Hence no need to
>> listen to the event at [2] which is just a communication channel between
>> Autoscaler and CC. I'm also not sure about how the startup order validation
>> could fail. It was working fine earlier. Will have to go through the logs
>> to see the actual root cause..
>>
>> Thanks,
>> Reka
>>
>>>
>>> [1] https://builds.apache.org/job/Stratos-41x-Commit-Build/87/
>>> [2]
>>> https://github.com/apache/stratos/blob/stratos-4.1.x/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusProcessorChain.java#L49
>>>
>>> Thanks.
>>>
>>>
>>> On Mon, Oct 12, 2015 at 9:28 PM, Thanuja Uruththirakodeeswaran <
>>> thanujau@wso2.com> wrote:
>>>
>>>> Hi All,
>>>>
>>>> I did several builds with latest changes. Each local build triggered
>>>> successfully with no test failures. But there are RuntimeExceptions.
>>>> I tried following scenarios
>>>> 1. Reverted metering service changes as in commit [1] - build success
>>>> 2. Build stratos 4.1.x branch with latest commit [2] - build success
>>>> 3. Build stratos 4.1.x branch without latest commit [2] - tests failed
>>>>
>>>> For the 3rd scenario, I got test failures as below and I've attached
>>>> part of test log here:
>>>>
>>>>
>>>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0, Time elapsed:
>>>> 1,499.716 sec <<< FAILURE! - in TestSuite
>>>> testTerminationBehavior(org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase)
>>>>  Time elapsed: 312.479 sec  <<< FAILURE!
>>>> java.lang.AssertionError:
>>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:33)
>>>> at
>>>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.assertCreationOfNodes(GroupStartupOrderTestCase.java:339)
>>>> at
>>>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.testTerminationBehavior(GroupStartupOrderTestCase.java:149)
>>>>
>>>> testApplication(org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase)
>>>>  Time elapsed: 0.351 sec  <<< FAILURE!
>>>> java.lang.AssertionError:
>>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>>> at
>>>> org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase.testApplication(SampleApplicationStartupTestCase.java:105)
>>>>
>>>> testApplicationList(org.apache.stratos.integration.tests.application.SampleApplicationsTestCase)
>>>>  Time elapsed: 1.032 sec  <<< FAILURE!
>>>> java.lang.AssertionError:
>>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>>> at
>>>> org.apache.stratos.integration.tests.application.SampleApplicationsTestCase.testApplicationList(SampleApplicationsTestCase.java:350)
>>>>
>>>> testApplicationBusting(org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase)
>>>>  Time elapsed: 32.926 sec  <<< FAILURE!
>>>> java.lang.AssertionError:
>>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>>> at
>>>> org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase.testApplicationBusting(ApplicationBurstingTestCase.java:138)
>>>>
>>>>
>>>> Results :
>>>>
>>>> Failed tests:
>>>>   ApplicationBurstingTestCase.testApplicationBusting:138
>>>>
>>>> GroupStartupOrderTestCase.testTerminationBehavior:149->assertCreationOfNodes:339
>>>>   SampleApplicationStartupTestCase.testApplication:105
>>>>   SampleApplicationsTestCase.testApplicationList:350
>>>>
>>>>
>>>>
>>>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0
>>>>
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>> [INFO] Reactor Summary:
>>>> [INFO]
>>>> [INFO] Apache Stratos - Integration Aggregation Module ... SUCCESS
>>>> [1.360s]
>>>> [INFO] Apache Stratos - Integration Common Module ........ SUCCESS
>>>> [6.356s]
>>>> [INFO] Apache Stratos - Integration Tests ................ FAILURE
>>>> [25:05.695s]
>>>> [INFO]
>>>> ------------------------------------------------------------------------
>>>>
>>>> I continuously ran more integration test on above scenarios and if I
>>>> get any different result, I'll update in this thread.
>>>>
>>>> [1].
>>>> https://github.com/Thanu/stratos/commit/631d1a1cc71ade793a6a6c59edabb34bd1594747
>>>> [2].
>>>> https://github.com/apache/stratos/commit/4bc27f29cb84d86fdaac554ca5a426cb0eb3776f
>>>>
>>>> Thanks.
>>>>
>>>> On Sun, Oct 11, 2015 at 6:29 PM, Gayan Gunarathne <ga...@wso2.com>
>>>> wrote:
>>>>
>>>>> Seems even application is terminated, some of the group monitors are
>>>>> still running. Mostly in the nested group scenario. Those group monitors
>>>>> looking for the application monitor that didn't exist at that time.So I
>>>>> think we need to recheck the logic of group monitor termination logic in
>>>>> the application un-deployment. Will check further on this.
>>>>>
>>>>> 2015-10-11 18:15:07 ERROR
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
>>>>> Exception in thread "pool-39-thread-36" java.lang.NullPointerException
>>>>> 2015-10-11 18:15:07 ERROR
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
>>>>> 2015-10-11 18:15:07 ERROR
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>>> 2015-10-11 18:15:07 ERROR
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>> 2015-10-11 18:15:07 ERROR
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>>> java.lang.Thread.run(Thread.java:744)
>>>>> 2015-10-11 18:15:07 INFO
>>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-11 18:15:07,285] DEBUG
>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>> monitor is running: [group] my-group6-group-startup-order-test
>>>>>
>>>>> Thanks,
>>>>> Gayan
>>>>>
>>>>> On Sat, Oct 10, 2015 at 3:35 PM, Akila Ravihansa Perera <
>>>>> ravihansa@wso2.com> wrote:
>>>>>
>>>>>> This is occurring frequently even in local build. I think this is a
>>>>>> blocker for 4.1.4 release.
>>>>>>
>>>>>> On Fri, Oct 9, 2015 at 9:20 PM, Imesh Gunaratne <im...@apache.org>
>>>>>> wrote:
>>>>>>
>>>>>>> Thanks Reka! It is important to identify the root cause of this
>>>>>>> issue. I'm also looking in.
>>>>>>>
>>>>>>> On Thu, Oct 8, 2015 at 6:13 PM, Reka Thirunavukkarasu <reka@wso2.com
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> Hi
>>>>>>>>
>>>>>>>> After going through the logs of integration, please find the break
>>>>>>>> down as below. For my-group6-group-tom2-group-startup-order-test, it
>>>>>>>> seems that the Adder got triggered twice or somehow monitor creation got
>>>>>>>> triggered twice which cause the memory to inconsistent state. Hence the
>>>>>>>> particular GroupMonitor got removed somehow. So that the application
>>>>>>>> hierarchy was incomplete and application was unable to become active. I'm
>>>>>>>> still investigating on it to find out the root cause.
>>>>>>>>
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>>> Monitor scheduled: [type] cluster [component]
>>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
>>>>>>>> ClusterMonitor task interval set to : [application-id] null [cluster]
>>>>>>>> group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
>>>>>>>> [monitor-interval] 90000
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>>> Starting monitor: [type] cluster [component]
>>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,504] ERROR
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
>>>>>>>> error occurred while starting monitor: [type] group [component]
>>>>>>>> my-group6-group-tom2-group-startup-order-test
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> java.lang.NullPointerException
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at
>>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>     at java.lang.Thread.run(Thread.java:745)
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>>>> monitor is running: [group] my-group6-group-tom2-group-startup-order-test
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>>> -  Instance expiry time is set to: 900000
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>>> -  Instance obsolete expiry time is set to: 86400000
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>>> -  Instance pending termination expiry time is set to: 1800000
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
>>>>>>>> [Partition] partition-1has been added for the [Group]
>>>>>>>> my-group9-group-startup-order-test
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>>> Monitor started successfully: [type] group [component]
>>>>>>>> my-group6-group-tom2-group-startup-order-test [dependents] none
>>>>>>>> [startup-time] 0 seconds
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>>>> [Instance context] group-startup-order-test-1 has been added to [Group]
>>>>>>>> my-group9-group-startup-order-test
>>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
>>>>>>>> the dependencies for the [Group] my-group9-group-startup-order-test
>>>>>>>>
>>>>>>>> --------------------------------------
>>>>>>>>
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>>>> -  Checking the status of cluster
>>>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>>>> instance status is: Active
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>>>> -  Checking the status of cluster
>>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>>> instance status is: Active
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>>> Write lock released
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
>>>>>>>> -  Sending group instance active for [group]
>>>>>>>> my-group6-group-tom2-group-startup-order-test [instance]
>>>>>>>> group-startup-order-test-1
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>>>> Handling group activation for the [group-id]:
>>>>>>>> my-group6-group-tom2-group-startup-order-test in the [application-id]
>>>>>>>> group-startup-order-test [instance] group-startup-order-test-1
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>>> Write lock acquired
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100]  WARN
>>>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>>>> Group monitor cannot be found: [group-id]
>>>>>>>> my-group6-group-tom2-group-startup-order-test [application-id]
>>>>>>>> group-startup-order-test
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
>>>>>>>> Cluster activated adding status started for
>>>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>>> Updating topology
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Reka
>>>>>>>>
>>>>>>>>
>>>>>>>> On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <
>>>>>>>> reka@wso2.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Akila
>>>>>>>>>
>>>>>>>>> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <
>>>>>>>>> ravihansa@wso2.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Thanuja,
>>>>>>>>>>
>>>>>>>>>> I was referring to the build fail in [1]. Please see line
>>>>>>>>>> starting from:
>>>>>>>>>>
>>>>>>>>>> 2015-10-02 07:28:32 INFO
>>>>>>>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>>> [2015-10-02 07:28:32,834] ERROR
>>>>>>>>>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>>>>>>>>>> instance
>>>>>>>>>>
>>>>>>>>>> I think this is a separate issue that occurs very rarely. As you
>>>>>>>>>> noticed, NPE in GroupMonitor occurs when undeploying applications. The
>>>>>>>>>> problem is group monitors are retrieving the status from other group
>>>>>>>>>> monitor objects.
>>>>>>>>>>
>>>>>>>>>> @Reka: shall we change that logic to read the application status
>>>>>>>>>> from topology or ApplicationHolder instead of reading from monitors?
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>> We can't read the Application status from Topology as Application
>>>>>>>>> will not contain any status rather only application instance will contain
>>>>>>>>> the status. By accessing application instance, we can't identify whether
>>>>>>>>> undeployment or force undeployment is in-progress. Hence we will have to
>>>>>>>>> maintain these flags to ApplicationMonitor to identity the undeployment or
>>>>>>>>> force undeployment. All other status are actually referring from the
>>>>>>>>> Topology.
>>>>>>>>>
>>>>>>>>> Thanks,
>>>>>>>>> Reka
>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> [1]
>>>>>>>>>> https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>>>>>>>>>
>>>>>>>>>> Thanks.
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Reka Thirunavukkarasu
>>>>>>>>> Senior Software Engineer,
>>>>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>>>>> Mobile: +94776442007
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Reka Thirunavukkarasu
>>>>>>>> Senior Software Engineer,
>>>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>>>> Mobile: +94776442007
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Imesh Gunaratne
>>>>>>>
>>>>>>> Senior Technical Lead, WSO2
>>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Akila Ravihansa Perera
>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>
>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>>
>>>>> Gayan Gunarathne
>>>>> Technical Lead, WSO2 Inc. (http://wso2.com)
>>>>> Committer & PMC Member, Apache Stratos
>>>>> email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thanuja Uruththirakodeeswaran
>>>> Software Engineer
>>>> WSO2 Inc.;http://wso2.com
>>>> lean.enterprise.middleware
>>>>
>>>> mobile: +94 774363167
>>>>
>>>
>>>
>>>
>>> --
>>> Akila Ravihansa Perera
>>> WSO2 Inc.;  http://wso2.com/
>>>
>>> Blog: http://ravihansa3000.blogspot.com
>>>
>>
>>
>>
>> --
>> Reka Thirunavukkarasu
>> Senior Software Engineer,
>> WSO2, Inc.:http://wso2.com,
>> Mobile: +94776442007
>>
>>
>>
>
>
> --
> Akila Ravihansa Perera
> WSO2 Inc.;  http://wso2.com/
>
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Reka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +94776442007

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
Hi Reka,

Yes, I meant we don't register any receivers for MemberActivated event in
TopologyHandler. Could you explain what happens in this piece of code in
ClusterStatusProcessorChain?

"root.process(type, clusterId, instanceId);"

Thanks.

On Mon, Oct 12, 2015 at 10:19 PM, Reka Thirunavukkarasu <re...@wso2.com>
wrote:

> Hi Akila/Thanuja,
>
> On Mon, Oct 12, 2015 at 9:59 PM, Akila Ravihansa Perera <
> ravihansa@wso2.com> wrote:
>
>> Hi Thanuja,
>>
>> Thanks for the update. It seems Stratos Jenkins build has returned to
>> normal with your last commit [1]. So could this duplicate call to sendMemberActivatedEvent()
>> method have been the culprit all this time?
>>
>> @Reka: Autoscaler is listening to MemberActivated event and executing
>> this logic at [2] for each event. Will it cause an issue if it is executed
>> multiple times? I cannot think of any other place it could have caused any
>> issue. Even TopologyHandler class used by integration tests do not listen
>> to this event.
>>
>
> TopologyHanlder is already listening to Topology events. Hence no need to
> listen to the event at [2] which is just a communication channel between
> Autoscaler and CC. I'm also not sure about how the startup order validation
> could fail. It was working fine earlier. Will have to go through the logs
> to see the actual root cause..
>
> Thanks,
> Reka
>
>>
>> [1] https://builds.apache.org/job/Stratos-41x-Commit-Build/87/
>> [2]
>> https://github.com/apache/stratos/blob/stratos-4.1.x/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusProcessorChain.java#L49
>>
>> Thanks.
>>
>>
>> On Mon, Oct 12, 2015 at 9:28 PM, Thanuja Uruththirakodeeswaran <
>> thanujau@wso2.com> wrote:
>>
>>> Hi All,
>>>
>>> I did several builds with latest changes. Each local build triggered
>>> successfully with no test failures. But there are RuntimeExceptions.
>>> I tried following scenarios
>>> 1. Reverted metering service changes as in commit [1] - build success
>>> 2. Build stratos 4.1.x branch with latest commit [2] - build success
>>> 3. Build stratos 4.1.x branch without latest commit [2] - tests failed
>>>
>>> For the 3rd scenario, I got test failures as below and I've attached
>>> part of test log here:
>>>
>>>
>>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0, Time elapsed:
>>> 1,499.716 sec <<< FAILURE! - in TestSuite
>>> testTerminationBehavior(org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase)
>>>  Time elapsed: 312.479 sec  <<< FAILURE!
>>> java.lang.AssertionError:
>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:33)
>>> at
>>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.assertCreationOfNodes(GroupStartupOrderTestCase.java:339)
>>> at
>>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.testTerminationBehavior(GroupStartupOrderTestCase.java:149)
>>>
>>> testApplication(org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase)
>>>  Time elapsed: 0.351 sec  <<< FAILURE!
>>> java.lang.AssertionError:
>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>> at
>>> org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase.testApplication(SampleApplicationStartupTestCase.java:105)
>>>
>>> testApplicationList(org.apache.stratos.integration.tests.application.SampleApplicationsTestCase)
>>>  Time elapsed: 1.032 sec  <<< FAILURE!
>>> java.lang.AssertionError:
>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>> at
>>> org.apache.stratos.integration.tests.application.SampleApplicationsTestCase.testApplicationList(SampleApplicationsTestCase.java:350)
>>>
>>> testApplicationBusting(org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase)
>>>  Time elapsed: 32.926 sec  <<< FAILURE!
>>> java.lang.AssertionError:
>>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>>> at
>>> org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase.testApplicationBusting(ApplicationBurstingTestCase.java:138)
>>>
>>>
>>> Results :
>>>
>>> Failed tests:
>>>   ApplicationBurstingTestCase.testApplicationBusting:138
>>>
>>> GroupStartupOrderTestCase.testTerminationBehavior:149->assertCreationOfNodes:339
>>>   SampleApplicationStartupTestCase.testApplication:105
>>>   SampleApplicationsTestCase.testApplicationList:350
>>>
>>>
>>>
>>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0
>>>
>>> [INFO]
>>> ------------------------------------------------------------------------
>>> [INFO] Reactor Summary:
>>> [INFO]
>>> [INFO] Apache Stratos - Integration Aggregation Module ... SUCCESS
>>> [1.360s]
>>> [INFO] Apache Stratos - Integration Common Module ........ SUCCESS
>>> [6.356s]
>>> [INFO] Apache Stratos - Integration Tests ................ FAILURE
>>> [25:05.695s]
>>> [INFO]
>>> ------------------------------------------------------------------------
>>>
>>> I continuously ran more integration test on above scenarios and if I get
>>> any different result, I'll update in this thread.
>>>
>>> [1].
>>> https://github.com/Thanu/stratos/commit/631d1a1cc71ade793a6a6c59edabb34bd1594747
>>> [2].
>>> https://github.com/apache/stratos/commit/4bc27f29cb84d86fdaac554ca5a426cb0eb3776f
>>>
>>> Thanks.
>>>
>>> On Sun, Oct 11, 2015 at 6:29 PM, Gayan Gunarathne <ga...@wso2.com>
>>> wrote:
>>>
>>>> Seems even application is terminated, some of the group monitors are
>>>> still running. Mostly in the nested group scenario. Those group monitors
>>>> looking for the application monitor that didn't exist at that time.So I
>>>> think we need to recheck the logic of group monitor termination logic in
>>>> the application un-deployment. Will check further on this.
>>>>
>>>> 2015-10-11 18:15:07 ERROR
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
>>>> Exception in thread "pool-39-thread-36" java.lang.NullPointerException
>>>> 2015-10-11 18:15:07 ERROR
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
>>>> 2015-10-11 18:15:07 ERROR
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>> 2015-10-11 18:15:07 ERROR
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>> 2015-10-11 18:15:07 ERROR
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>>> java.lang.Thread.run(Thread.java:744)
>>>> 2015-10-11 18:15:07 INFO
>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-11 18:15:07,285] DEBUG
>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>> monitor is running: [group] my-group6-group-startup-order-test
>>>>
>>>> Thanks,
>>>> Gayan
>>>>
>>>> On Sat, Oct 10, 2015 at 3:35 PM, Akila Ravihansa Perera <
>>>> ravihansa@wso2.com> wrote:
>>>>
>>>>> This is occurring frequently even in local build. I think this is a
>>>>> blocker for 4.1.4 release.
>>>>>
>>>>> On Fri, Oct 9, 2015 at 9:20 PM, Imesh Gunaratne <im...@apache.org>
>>>>> wrote:
>>>>>
>>>>>> Thanks Reka! It is important to identify the root cause of this
>>>>>> issue. I'm also looking in.
>>>>>>
>>>>>> On Thu, Oct 8, 2015 at 6:13 PM, Reka Thirunavukkarasu <re...@wso2.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi
>>>>>>>
>>>>>>> After going through the logs of integration, please find the break
>>>>>>> down as below. For my-group6-group-tom2-group-startup-order-test, it
>>>>>>> seems that the Adder got triggered twice or somehow monitor creation got
>>>>>>> triggered twice which cause the memory to inconsistent state. Hence the
>>>>>>> particular GroupMonitor got removed somehow. So that the application
>>>>>>> hierarchy was incomplete and application was unable to become active. I'm
>>>>>>> still investigating on it to find out the root cause.
>>>>>>>
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>> Monitor scheduled: [type] cluster [component]
>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
>>>>>>> ClusterMonitor task interval set to : [application-id] null [cluster]
>>>>>>> group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
>>>>>>> [monitor-interval] 90000
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>> Starting monitor: [type] cluster [component]
>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,504] ERROR
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
>>>>>>> error occurred while starting monitor: [type] group [component]
>>>>>>> my-group6-group-tom2-group-startup-order-test
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> java.lang.NullPointerException
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at
>>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>     at java.lang.Thread.run(Thread.java:745)
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>>> monitor is running: [group] my-group6-group-tom2-group-startup-order-test
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>> -  Instance expiry time is set to: 900000
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>> -  Instance obsolete expiry time is set to: 86400000
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>>> -  Instance pending termination expiry time is set to: 1800000
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
>>>>>>> [Partition] partition-1has been added for the [Group]
>>>>>>> my-group9-group-startup-order-test
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>>> Monitor started successfully: [type] group [component]
>>>>>>> my-group6-group-tom2-group-startup-order-test [dependents] none
>>>>>>> [startup-time] 0 seconds
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>>> [Instance context] group-startup-order-test-1 has been added to [Group]
>>>>>>> my-group9-group-startup-order-test
>>>>>>> 2015-10-08 13:49:52 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
>>>>>>> the dependencies for the [Group] my-group9-group-startup-order-test
>>>>>>>
>>>>>>> --------------------------------------
>>>>>>>
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>>> -  Checking the status of cluster
>>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>>> instance status is: Active
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>>> -  Checking the status of cluster
>>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>>> instance status is: Active
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>> Write lock released
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
>>>>>>> -  Sending group instance active for [group]
>>>>>>> my-group6-group-tom2-group-startup-order-test [instance]
>>>>>>> group-startup-order-test-1
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>>> Handling group activation for the [group-id]:
>>>>>>> my-group6-group-tom2-group-startup-order-test in the [application-id]
>>>>>>> group-startup-order-test [instance] group-startup-order-test-1
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>> Write lock acquired
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100]  WARN
>>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>>> Group monitor cannot be found: [group-id]
>>>>>>> my-group6-group-tom2-group-startup-order-test [application-id]
>>>>>>> group-startup-order-test
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
>>>>>>> Cluster activated adding status started for
>>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>>> 2015-10-08 13:51:19 INFO
>>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>>> Updating topology
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Reka
>>>>>>>
>>>>>>>
>>>>>>> On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <reka@wso2.com
>>>>>>> > wrote:
>>>>>>>
>>>>>>>> Hi Akila
>>>>>>>>
>>>>>>>> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <
>>>>>>>> ravihansa@wso2.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Thanuja,
>>>>>>>>>
>>>>>>>>> I was referring to the build fail in [1]. Please see line starting
>>>>>>>>> from:
>>>>>>>>>
>>>>>>>>> 2015-10-02 07:28:32 INFO
>>>>>>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>>> [2015-10-02 07:28:32,834] ERROR
>>>>>>>>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>>>>>>>>> instance
>>>>>>>>>
>>>>>>>>> I think this is a separate issue that occurs very rarely. As you
>>>>>>>>> noticed, NPE in GroupMonitor occurs when undeploying applications. The
>>>>>>>>> problem is group monitors are retrieving the status from other group
>>>>>>>>> monitor objects.
>>>>>>>>>
>>>>>>>>> @Reka: shall we change that logic to read the application status
>>>>>>>>> from topology or ApplicationHolder instead of reading from monitors?
>>>>>>>>>
>>>>>>>>
>>>>>>>> We can't read the Application status from Topology as Application
>>>>>>>> will not contain any status rather only application instance will contain
>>>>>>>> the status. By accessing application instance, we can't identify whether
>>>>>>>> undeployment or force undeployment is in-progress. Hence we will have to
>>>>>>>> maintain these flags to ApplicationMonitor to identity the undeployment or
>>>>>>>> force undeployment. All other status are actually referring from the
>>>>>>>> Topology.
>>>>>>>>
>>>>>>>> Thanks,
>>>>>>>> Reka
>>>>>>>>
>>>>>>>>>
>>>>>>>>> [1]
>>>>>>>>> https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Reka Thirunavukkarasu
>>>>>>>> Senior Software Engineer,
>>>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>>>> Mobile: +94776442007
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Reka Thirunavukkarasu
>>>>>>> Senior Software Engineer,
>>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>>> Mobile: +94776442007
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Imesh Gunaratne
>>>>>>
>>>>>> Senior Technical Lead, WSO2
>>>>>> Committer & PMC Member, Apache Stratos
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Akila Ravihansa Perera
>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>
>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>>
>>>> Gayan Gunarathne
>>>> Technical Lead, WSO2 Inc. (http://wso2.com)
>>>> Committer & PMC Member, Apache Stratos
>>>> email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>
>>>>
>>>>
>>>>
>>>
>>>
>>>
>>> --
>>> Thanuja Uruththirakodeeswaran
>>> Software Engineer
>>> WSO2 Inc.;http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: +94 774363167
>>>
>>
>>
>>
>> --
>> Akila Ravihansa Perera
>> WSO2 Inc.;  http://wso2.com/
>>
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
> Reka Thirunavukkarasu
> Senior Software Engineer,
> WSO2, Inc.:http://wso2.com,
> Mobile: +94776442007
>
>
>


-- 
Akila Ravihansa Perera
WSO2 Inc.;  http://wso2.com/

Blog: http://ravihansa3000.blogspot.com

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Reka Thirunavukkarasu <re...@wso2.com>.
Hi Akila/Thanuja,

On Mon, Oct 12, 2015 at 9:59 PM, Akila Ravihansa Perera <ra...@wso2.com>
wrote:

> Hi Thanuja,
>
> Thanks for the update. It seems Stratos Jenkins build has returned to
> normal with your last commit [1]. So could this duplicate call to sendMemberActivatedEvent()
> method have been the culprit all this time?
>
> @Reka: Autoscaler is listening to MemberActivated event and executing this
> logic at [2] for each event. Will it cause an issue if it is executed
> multiple times? I cannot think of any other place it could have caused any
> issue. Even TopologyHandler class used by integration tests do not listen
> to this event.
>

TopologyHanlder is already listening to Topology events. Hence no need to
listen to the event at [2] which is just a communication channel between
Autoscaler and CC. I'm also not sure about how the startup order validation
could fail. It was working fine earlier. Will have to go through the logs
to see the actual root cause..

Thanks,
Reka

>
> [1] https://builds.apache.org/job/Stratos-41x-Commit-Build/87/
> [2]
> https://github.com/apache/stratos/blob/stratos-4.1.x/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusProcessorChain.java#L49
>
> Thanks.
>
>
> On Mon, Oct 12, 2015 at 9:28 PM, Thanuja Uruththirakodeeswaran <
> thanujau@wso2.com> wrote:
>
>> Hi All,
>>
>> I did several builds with latest changes. Each local build triggered
>> successfully with no test failures. But there are RuntimeExceptions.
>> I tried following scenarios
>> 1. Reverted metering service changes as in commit [1] - build success
>> 2. Build stratos 4.1.x branch with latest commit [2] - build success
>> 3. Build stratos 4.1.x branch without latest commit [2] - tests failed
>>
>> For the 3rd scenario, I got test failures as below and I've attached part
>> of test log here:
>>
>>
>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0, Time elapsed:
>> 1,499.716 sec <<< FAILURE! - in TestSuite
>> testTerminationBehavior(org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase)
>>  Time elapsed: 312.479 sec  <<< FAILURE!
>> java.lang.AssertionError:
>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:33)
>> at
>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.assertCreationOfNodes(GroupStartupOrderTestCase.java:339)
>> at
>> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.testTerminationBehavior(GroupStartupOrderTestCase.java:149)
>>
>> testApplication(org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase)
>>  Time elapsed: 0.351 sec  <<< FAILURE!
>> java.lang.AssertionError:
>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>> at
>> org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase.testApplication(SampleApplicationStartupTestCase.java:105)
>>
>> testApplicationList(org.apache.stratos.integration.tests.application.SampleApplicationsTestCase)
>>  Time elapsed: 1.032 sec  <<< FAILURE!
>> java.lang.AssertionError:
>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>> at
>> org.apache.stratos.integration.tests.application.SampleApplicationsTestCase.testApplicationList(SampleApplicationsTestCase.java:350)
>>
>> testApplicationBusting(org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase)
>>  Time elapsed: 32.926 sec  <<< FAILURE!
>> java.lang.AssertionError:
>> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
>> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
>> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
>> at
>> org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase.testApplicationBusting(ApplicationBurstingTestCase.java:138)
>>
>>
>> Results :
>>
>> Failed tests:
>>   ApplicationBurstingTestCase.testApplicationBusting:138
>>
>> GroupStartupOrderTestCase.testTerminationBehavior:149->assertCreationOfNodes:339
>>   SampleApplicationStartupTestCase.testApplication:105
>>   SampleApplicationsTestCase.testApplicationList:350
>>
>>
>>
>> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0
>>
>> [INFO]
>> ------------------------------------------------------------------------
>> [INFO] Reactor Summary:
>> [INFO]
>> [INFO] Apache Stratos - Integration Aggregation Module ... SUCCESS
>> [1.360s]
>> [INFO] Apache Stratos - Integration Common Module ........ SUCCESS
>> [6.356s]
>> [INFO] Apache Stratos - Integration Tests ................ FAILURE
>> [25:05.695s]
>> [INFO]
>> ------------------------------------------------------------------------
>>
>> I continuously ran more integration test on above scenarios and if I get
>> any different result, I'll update in this thread.
>>
>> [1].
>> https://github.com/Thanu/stratos/commit/631d1a1cc71ade793a6a6c59edabb34bd1594747
>> [2].
>> https://github.com/apache/stratos/commit/4bc27f29cb84d86fdaac554ca5a426cb0eb3776f
>>
>> Thanks.
>>
>> On Sun, Oct 11, 2015 at 6:29 PM, Gayan Gunarathne <ga...@wso2.com>
>> wrote:
>>
>>> Seems even application is terminated, some of the group monitors are
>>> still running. Mostly in the nested group scenario. Those group monitors
>>> looking for the application monitor that didn't exist at that time.So I
>>> think we need to recheck the logic of group monitor termination logic in
>>> the application un-deployment. Will check further on this.
>>>
>>> 2015-10-11 18:15:07 ERROR
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
>>> Exception in thread "pool-39-thread-36" java.lang.NullPointerException
>>> 2015-10-11 18:15:07 ERROR
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
>>> 2015-10-11 18:15:07 ERROR
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>> 2015-10-11 18:15:07 ERROR
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>> 2015-10-11 18:15:07 ERROR
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>>> java.lang.Thread.run(Thread.java:744)
>>> 2015-10-11 18:15:07 INFO
>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-11 18:15:07,285] DEBUG
>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>> monitor is running: [group] my-group6-group-startup-order-test
>>>
>>> Thanks,
>>> Gayan
>>>
>>> On Sat, Oct 10, 2015 at 3:35 PM, Akila Ravihansa Perera <
>>> ravihansa@wso2.com> wrote:
>>>
>>>> This is occurring frequently even in local build. I think this is a
>>>> blocker for 4.1.4 release.
>>>>
>>>> On Fri, Oct 9, 2015 at 9:20 PM, Imesh Gunaratne <im...@apache.org>
>>>> wrote:
>>>>
>>>>> Thanks Reka! It is important to identify the root cause of this issue.
>>>>> I'm also looking in.
>>>>>
>>>>> On Thu, Oct 8, 2015 at 6:13 PM, Reka Thirunavukkarasu <re...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> Hi
>>>>>>
>>>>>> After going through the logs of integration, please find the break
>>>>>> down as below. For my-group6-group-tom2-group-startup-order-test, it
>>>>>> seems that the Adder got triggered twice or somehow monitor creation got
>>>>>> triggered twice which cause the memory to inconsistent state. Hence the
>>>>>> particular GroupMonitor got removed somehow. So that the application
>>>>>> hierarchy was incomplete and application was unable to become active. I'm
>>>>>> still investigating on it to find out the root cause.
>>>>>>
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>> Monitor scheduled: [type] cluster [component]
>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>> {org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
>>>>>> ClusterMonitor task interval set to : [application-id] null [cluster]
>>>>>> group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
>>>>>> [monitor-interval] 90000
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>> Starting monitor: [type] cluster [component]
>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,504] ERROR
>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
>>>>>> error occurred while starting monitor: [type] group [component]
>>>>>> my-group6-group-tom2-group-startup-order-test
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> java.lang.NullPointerException
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at
>>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>     at java.lang.Thread.run(Thread.java:745)
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>> monitor is running: [group] my-group6-group-tom2-group-startup-order-test
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>> -  Instance expiry time is set to: 900000
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>> -  Instance obsolete expiry time is set to: 86400000
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>>> -  Instance pending termination expiry time is set to: 1800000
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
>>>>>> [Partition] partition-1has been added for the [Group]
>>>>>> my-group9-group-startup-order-test
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>>> Monitor started successfully: [type] group [component]
>>>>>> my-group6-group-tom2-group-startup-order-test [dependents] none
>>>>>> [startup-time] 0 seconds
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>>> [Instance context] group-startup-order-test-1 has been added to [Group]
>>>>>> my-group9-group-startup-order-test
>>>>>> 2015-10-08 13:49:52 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
>>>>>> the dependencies for the [Group] my-group9-group-startup-order-test
>>>>>>
>>>>>> --------------------------------------
>>>>>>
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>> -  Checking the status of cluster
>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>> instance status is: Active
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>>> -  Checking the status of cluster
>>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>>> instance status is: Active
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>> Write lock released
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
>>>>>> -  Sending group instance active for [group]
>>>>>> my-group6-group-tom2-group-startup-order-test [instance]
>>>>>> group-startup-order-test-1
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>> Handling group activation for the [group-id]:
>>>>>> my-group6-group-tom2-group-startup-order-test in the [application-id]
>>>>>> group-startup-order-test [instance] group-startup-order-test-1
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>> Write lock acquired
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100]  WARN
>>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>>> Group monitor cannot be found: [group-id]
>>>>>> my-group6-group-tom2-group-startup-order-test [application-id]
>>>>>> group-startup-order-test
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
>>>>>> Cluster activated adding status started for
>>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>>> 2015-10-08 13:51:19 INFO
>>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>>> Updating topology
>>>>>>
>>>>>> Thanks,
>>>>>> Reka
>>>>>>
>>>>>>
>>>>>> On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <re...@wso2.com>
>>>>>> wrote:
>>>>>>
>>>>>>> Hi Akila
>>>>>>>
>>>>>>> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <
>>>>>>> ravihansa@wso2.com> wrote:
>>>>>>>
>>>>>>>> Hi Thanuja,
>>>>>>>>
>>>>>>>> I was referring to the build fail in [1]. Please see line starting
>>>>>>>> from:
>>>>>>>>
>>>>>>>> 2015-10-02 07:28:32 INFO
>>>>>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>>> [2015-10-02 07:28:32,834] ERROR
>>>>>>>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>>>>>>>> instance
>>>>>>>>
>>>>>>>> I think this is a separate issue that occurs very rarely. As you
>>>>>>>> noticed, NPE in GroupMonitor occurs when undeploying applications. The
>>>>>>>> problem is group monitors are retrieving the status from other group
>>>>>>>> monitor objects.
>>>>>>>>
>>>>>>>> @Reka: shall we change that logic to read the application status
>>>>>>>> from topology or ApplicationHolder instead of reading from monitors?
>>>>>>>>
>>>>>>>
>>>>>>> We can't read the Application status from Topology as Application
>>>>>>> will not contain any status rather only application instance will contain
>>>>>>> the status. By accessing application instance, we can't identify whether
>>>>>>> undeployment or force undeployment is in-progress. Hence we will have to
>>>>>>> maintain these flags to ApplicationMonitor to identity the undeployment or
>>>>>>> force undeployment. All other status are actually referring from the
>>>>>>> Topology.
>>>>>>>
>>>>>>> Thanks,
>>>>>>> Reka
>>>>>>>
>>>>>>>>
>>>>>>>> [1]
>>>>>>>> https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Reka Thirunavukkarasu
>>>>>>> Senior Software Engineer,
>>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>>> Mobile: +94776442007
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Reka Thirunavukkarasu
>>>>>> Senior Software Engineer,
>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>> Mobile: +94776442007
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Imesh Gunaratne
>>>>>
>>>>> Senior Technical Lead, WSO2
>>>>> Committer & PMC Member, Apache Stratos
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Akila Ravihansa Perera
>>>> WSO2 Inc.;  http://wso2.com/
>>>>
>>>> Blog: http://ravihansa3000.blogspot.com
>>>>
>>>
>>>
>>>
>>> --
>>>
>>> Gayan Gunarathne
>>> Technical Lead, WSO2 Inc. (http://wso2.com)
>>> Committer & PMC Member, Apache Stratos
>>> email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>
>>>
>>>
>>>
>>
>>
>>
>> --
>> Thanuja Uruththirakodeeswaran
>> Software Engineer
>> WSO2 Inc.;http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 774363167
>>
>
>
>
> --
> Akila Ravihansa Perera
> WSO2 Inc.;  http://wso2.com/
>
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Reka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +94776442007

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
Hi Thanuja,

Thanks for the update. It seems Stratos Jenkins build has returned to
normal with your last commit [1]. So could this duplicate call to
sendMemberActivatedEvent()
method have been the culprit all this time?

@Reka: Autoscaler is listening to MemberActivated event and executing this
logic at [2] for each event. Will it cause an issue if it is executed
multiple times? I cannot think of any other place it could have caused any
issue. Even TopologyHandler class used by integration tests do not listen
to this event.

[1] https://builds.apache.org/job/Stratos-41x-Commit-Build/87/
[2]
https://github.com/apache/stratos/blob/stratos-4.1.x/components/org.apache.stratos.autoscaler/src/main/java/org/apache/stratos/autoscaler/status/processor/cluster/ClusterStatusProcessorChain.java#L49

Thanks.


On Mon, Oct 12, 2015 at 9:28 PM, Thanuja Uruththirakodeeswaran <
thanujau@wso2.com> wrote:

> Hi All,
>
> I did several builds with latest changes. Each local build triggered
> successfully with no test failures. But there are RuntimeExceptions.
> I tried following scenarios
> 1. Reverted metering service changes as in commit [1] - build success
> 2. Build stratos 4.1.x branch with latest commit [2] - build success
> 3. Build stratos 4.1.x branch without latest commit [2] - tests failed
>
> For the 3rd scenario, I got test failures as below and I've attached part
> of test log here:
>
>
> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 1,499.716
> sec <<< FAILURE! - in TestSuite
> testTerminationBehavior(org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase)
>  Time elapsed: 312.479 sec  <<< FAILURE!
> java.lang.AssertionError:
> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:33)
> at
> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.assertCreationOfNodes(GroupStartupOrderTestCase.java:339)
> at
> org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.testTerminationBehavior(GroupStartupOrderTestCase.java:149)
>
> testApplication(org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase)
>  Time elapsed: 0.351 sec  <<< FAILURE!
> java.lang.AssertionError:
> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
> at
> org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase.testApplication(SampleApplicationStartupTestCase.java:105)
>
> testApplicationList(org.apache.stratos.integration.tests.application.SampleApplicationsTestCase)
>  Time elapsed: 1.032 sec  <<< FAILURE!
> java.lang.AssertionError:
> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
> at
> org.apache.stratos.integration.tests.application.SampleApplicationsTestCase.testApplicationList(SampleApplicationsTestCase.java:350)
>
> testApplicationBusting(org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase)
>  Time elapsed: 32.926 sec  <<< FAILURE!
> java.lang.AssertionError:
> at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
> at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
> at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
> at
> org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase.testApplicationBusting(ApplicationBurstingTestCase.java:138)
>
>
> Results :
>
> Failed tests:
>   ApplicationBurstingTestCase.testApplicationBusting:138
>
> GroupStartupOrderTestCase.testTerminationBehavior:149->assertCreationOfNodes:339
>   SampleApplicationStartupTestCase.testApplication:105
>   SampleApplicationsTestCase.testApplicationList:350
>
>
>
> Tests run: 21, Failures: 4, Errors: 0, Skipped: 0
>
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Reactor Summary:
> [INFO]
> [INFO] Apache Stratos - Integration Aggregation Module ... SUCCESS [1.360s]
> [INFO] Apache Stratos - Integration Common Module ........ SUCCESS [6.356s]
> [INFO] Apache Stratos - Integration Tests ................ FAILURE
> [25:05.695s]
> [INFO]
> ------------------------------------------------------------------------
>
> I continuously ran more integration test on above scenarios and if I get
> any different result, I'll update in this thread.
>
> [1].
> https://github.com/Thanu/stratos/commit/631d1a1cc71ade793a6a6c59edabb34bd1594747
> [2].
> https://github.com/apache/stratos/commit/4bc27f29cb84d86fdaac554ca5a426cb0eb3776f
>
> Thanks.
>
> On Sun, Oct 11, 2015 at 6:29 PM, Gayan Gunarathne <ga...@wso2.com> wrote:
>
>> Seems even application is terminated, some of the group monitors are
>> still running. Mostly in the nested group scenario. Those group monitors
>> looking for the application monitor that didn't exist at that time.So I
>> think we need to recheck the logic of group monitor termination logic in
>> the application un-deployment. Will check further on this.
>>
>> 2015-10-11 18:15:07 ERROR
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
>> Exception in thread "pool-39-thread-36" java.lang.NullPointerException
>> 2015-10-11 18:15:07 ERROR
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
>> 2015-10-11 18:15:07 ERROR
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>> 2015-10-11 18:15:07 ERROR
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>> 2015-10-11 18:15:07 ERROR
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
>> java.lang.Thread.run(Thread.java:744)
>> 2015-10-11 18:15:07 INFO
>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-11 18:15:07,285] DEBUG
>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>> monitor is running: [group] my-group6-group-startup-order-test
>>
>> Thanks,
>> Gayan
>>
>> On Sat, Oct 10, 2015 at 3:35 PM, Akila Ravihansa Perera <
>> ravihansa@wso2.com> wrote:
>>
>>> This is occurring frequently even in local build. I think this is a
>>> blocker for 4.1.4 release.
>>>
>>> On Fri, Oct 9, 2015 at 9:20 PM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>
>>>> Thanks Reka! It is important to identify the root cause of this issue.
>>>> I'm also looking in.
>>>>
>>>> On Thu, Oct 8, 2015 at 6:13 PM, Reka Thirunavukkarasu <re...@wso2.com>
>>>> wrote:
>>>>
>>>>> Hi
>>>>>
>>>>> After going through the logs of integration, please find the break
>>>>> down as below. For my-group6-group-tom2-group-startup-order-test, it
>>>>> seems that the Adder got triggered twice or somehow monitor creation got
>>>>> triggered twice which cause the memory to inconsistent state. Hence the
>>>>> particular GroupMonitor got removed somehow. So that the application
>>>>> hierarchy was incomplete and application was unable to become active. I'm
>>>>> still investigating on it to find out the root cause.
>>>>>
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>> Monitor scheduled: [type] cluster [component]
>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>> {org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
>>>>> ClusterMonitor task interval set to : [application-id] null [cluster]
>>>>> group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
>>>>> [monitor-interval] 90000
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,504]  INFO
>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>> Starting monitor: [type] cluster [component]
>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,504] ERROR
>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
>>>>> error occurred while starting monitor: [type] group [component]
>>>>> my-group6-group-tom2-group-startup-order-test
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> java.lang.NullPointerException
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>     at
>>>>> org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>     at
>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>     at
>>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>     at
>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>     at
>>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>     at
>>>>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>     at
>>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>     at
>>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>     at
>>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>     at java.lang.Thread.run(Thread.java:745)
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>> monitor is running: [group] my-group6-group-tom2-group-startup-order-test
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,504] DEBUG
>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>> -  Instance expiry time is set to: 900000
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>> -  Instance obsolete expiry time is set to: 86400000
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,505] DEBUG
>>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>>> -  Instance pending termination expiry time is set to: 1800000
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
>>>>> [Partition] partition-1has been added for the [Group]
>>>>> my-group9-group-startup-order-test
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>>> Monitor started successfully: [type] group [component]
>>>>> my-group6-group-tom2-group-startup-order-test [dependents] none
>>>>> [startup-time] 0 seconds
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>>> [Instance context] group-startup-order-test-1 has been added to [Group]
>>>>> my-group9-group-startup-order-test
>>>>> 2015-10-08 13:49:52 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:49:52,505]  INFO
>>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
>>>>> the dependencies for the [Group] my-group9-group-startup-order-test
>>>>>
>>>>> --------------------------------------
>>>>>
>>>>> 2015-10-08 13:51:19 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>> -  Checking the status of cluster
>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>> instance status is: Active
>>>>> 2015-10-08 13:51:19 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>>> -  Checking the status of cluster
>>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>>> instance status is: Active
>>>>> 2015-10-08 13:51:19 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>> Write lock released
>>>>> 2015-10-08 13:51:19 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
>>>>> -  Sending group instance active for [group]
>>>>> my-group6-group-tom2-group-startup-order-test [instance]
>>>>> group-startup-order-test-1
>>>>> 2015-10-08 13:51:19 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>> Handling group activation for the [group-id]:
>>>>> my-group6-group-tom2-group-startup-order-test in the [application-id]
>>>>> group-startup-order-test [instance] group-startup-order-test-1
>>>>> 2015-10-08 13:51:19 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>> Write lock acquired
>>>>> 2015-10-08 13:51:19 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:51:19,100]  WARN
>>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>>> Group monitor cannot be found: [group-id]
>>>>> my-group6-group-tom2-group-startup-order-test [application-id]
>>>>> group-startup-order-test
>>>>> 2015-10-08 13:51:19 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:51:19,100]  INFO
>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
>>>>> Cluster activated adding status started for
>>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>>> 2015-10-08 13:51:19 INFO
>>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-08 13:51:19,100] DEBUG
>>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>>> Updating topology
>>>>>
>>>>> Thanks,
>>>>> Reka
>>>>>
>>>>>
>>>>> On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <re...@wso2.com>
>>>>> wrote:
>>>>>
>>>>>> Hi Akila
>>>>>>
>>>>>> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <
>>>>>> ravihansa@wso2.com> wrote:
>>>>>>
>>>>>>> Hi Thanuja,
>>>>>>>
>>>>>>> I was referring to the build fail in [1]. Please see line starting
>>>>>>> from:
>>>>>>>
>>>>>>> 2015-10-02 07:28:32 INFO
>>>>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>>> [2015-10-02 07:28:32,834] ERROR
>>>>>>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>>>>>>> instance
>>>>>>>
>>>>>>> I think this is a separate issue that occurs very rarely. As you
>>>>>>> noticed, NPE in GroupMonitor occurs when undeploying applications. The
>>>>>>> problem is group monitors are retrieving the status from other group
>>>>>>> monitor objects.
>>>>>>>
>>>>>>> @Reka: shall we change that logic to read the application status
>>>>>>> from topology or ApplicationHolder instead of reading from monitors?
>>>>>>>
>>>>>>
>>>>>> We can't read the Application status from Topology as Application
>>>>>> will not contain any status rather only application instance will contain
>>>>>> the status. By accessing application instance, we can't identify whether
>>>>>> undeployment or force undeployment is in-progress. Hence we will have to
>>>>>> maintain these flags to ApplicationMonitor to identity the undeployment or
>>>>>> force undeployment. All other status are actually referring from the
>>>>>> Topology.
>>>>>>
>>>>>> Thanks,
>>>>>> Reka
>>>>>>
>>>>>>>
>>>>>>> [1]
>>>>>>> https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Reka Thirunavukkarasu
>>>>>> Senior Software Engineer,
>>>>>> WSO2, Inc.:http://wso2.com,
>>>>>> Mobile: +94776442007
>>>>>>
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Reka Thirunavukkarasu
>>>>> Senior Software Engineer,
>>>>> WSO2, Inc.:http://wso2.com,
>>>>> Mobile: +94776442007
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Senior Technical Lead, WSO2
>>>> Committer & PMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>> Akila Ravihansa Perera
>>> WSO2 Inc.;  http://wso2.com/
>>>
>>> Blog: http://ravihansa3000.blogspot.com
>>>
>>
>>
>>
>> --
>>
>> Gayan Gunarathne
>> Technical Lead, WSO2 Inc. (http://wso2.com)
>> Committer & PMC Member, Apache Stratos
>> email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>
>>
>>
>>
>
>
>
> --
> Thanuja Uruththirakodeeswaran
> Software Engineer
> WSO2 Inc.;http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 774363167
>



-- 
Akila Ravihansa Perera
WSO2 Inc.;  http://wso2.com/

Blog: http://ravihansa3000.blogspot.com

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Thanuja Uruththirakodeeswaran <th...@wso2.com>.
Hi All,

I did several builds with latest changes. Each local build triggered
successfully with no test failures. But there are RuntimeExceptions.
I tried following scenarios
1. Reverted metering service changes as in commit [1] - build success
2. Build stratos 4.1.x branch with latest commit [2] - build success
3. Build stratos 4.1.x branch without latest commit [2] - tests failed

For the 3rd scenario, I got test failures as below and I've attached part
of test log here:


Tests run: 21, Failures: 4, Errors: 0, Skipped: 0, Time elapsed: 1,499.716
sec <<< FAILURE! - in TestSuite
testTerminationBehavior(org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase)
 Time elapsed: 312.479 sec  <<< FAILURE!
java.lang.AssertionError:
at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:33)
at
org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.assertCreationOfNodes(GroupStartupOrderTestCase.java:339)
at
org.apache.stratos.integration.tests.application.GroupStartupOrderTestCase.testTerminationBehavior(GroupStartupOrderTestCase.java:149)

testApplication(org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase)
 Time elapsed: 0.351 sec  <<< FAILURE!
java.lang.AssertionError:
at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
at
org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase.testApplication(SampleApplicationStartupTestCase.java:105)

testApplicationList(org.apache.stratos.integration.tests.application.SampleApplicationsTestCase)
 Time elapsed: 1.032 sec  <<< FAILURE!
java.lang.AssertionError:
at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
at
org.apache.stratos.integration.tests.application.SampleApplicationsTestCase.testApplicationList(SampleApplicationsTestCase.java:350)

testApplicationBusting(org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase)
 Time elapsed: 32.926 sec  <<< FAILURE!
java.lang.AssertionError:
at org.testng.AssertJUnit.fail(AssertJUnit.java:59)
at org.testng.AssertJUnit.assertTrue(AssertJUnit.java:24)
at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:41)
at org.testng.AssertJUnit.assertFalse(AssertJUnit.java:49)
at
org.apache.stratos.integration.tests.application.ApplicationBurstingTestCase.testApplicationBusting(ApplicationBurstingTestCase.java:138)


Results :

Failed tests:
  ApplicationBurstingTestCase.testApplicationBusting:138

GroupStartupOrderTestCase.testTerminationBehavior:149->assertCreationOfNodes:339
  SampleApplicationStartupTestCase.testApplication:105
  SampleApplicationsTestCase.testApplicationList:350



Tests run: 21, Failures: 4, Errors: 0, Skipped: 0

[INFO]
------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Apache Stratos - Integration Aggregation Module ... SUCCESS [1.360s]
[INFO] Apache Stratos - Integration Common Module ........ SUCCESS [6.356s]
[INFO] Apache Stratos - Integration Tests ................ FAILURE
[25:05.695s]
[INFO]
------------------------------------------------------------------------

I continuously ran more integration test on above scenarios and if I get
any different result, I'll update in this thread.

[1].
https://github.com/Thanu/stratos/commit/631d1a1cc71ade793a6a6c59edabb34bd1594747
[2].
https://github.com/apache/stratos/commit/4bc27f29cb84d86fdaac554ca5a426cb0eb3776f

Thanks.

On Sun, Oct 11, 2015 at 6:29 PM, Gayan Gunarathne <ga...@wso2.com> wrote:

> Seems even application is terminated, some of the group monitors are still
> running. Mostly in the nested group scenario. Those group monitors looking
> for the application monitor that didn't exist at that time.So I think we
> need to recheck the logic of group monitor termination logic in the
> application un-deployment. Will check further on this.
>
> 2015-10-11 18:15:07 ERROR
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
> Exception in thread "pool-39-thread-36" java.lang.NullPointerException
> 2015-10-11 18:15:07 ERROR
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
> org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
> 2015-10-11 18:15:07 ERROR
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 2015-10-11 18:15:07 ERROR
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 2015-10-11 18:15:07 ERROR
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
> java.lang.Thread.run(Thread.java:744)
> 2015-10-11 18:15:07 INFO
>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-11 18:15:07,285] DEBUG
> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
> monitor is running: [group] my-group6-group-startup-order-test
>
> Thanks,
> Gayan
>
> On Sat, Oct 10, 2015 at 3:35 PM, Akila Ravihansa Perera <
> ravihansa@wso2.com> wrote:
>
>> This is occurring frequently even in local build. I think this is a
>> blocker for 4.1.4 release.
>>
>> On Fri, Oct 9, 2015 at 9:20 PM, Imesh Gunaratne <im...@apache.org> wrote:
>>
>>> Thanks Reka! It is important to identify the root cause of this issue.
>>> I'm also looking in.
>>>
>>> On Thu, Oct 8, 2015 at 6:13 PM, Reka Thirunavukkarasu <re...@wso2.com>
>>> wrote:
>>>
>>>> Hi
>>>>
>>>> After going through the logs of integration, please find the break down
>>>> as below. For my-group6-group-tom2-group-startup-order-test, it seems
>>>> that the Adder got triggered twice or somehow monitor creation got
>>>> triggered twice which cause the memory to inconsistent state. Hence the
>>>> particular GroupMonitor got removed somehow. So that the application
>>>> hierarchy was incomplete and application was unable to become active. I'm
>>>> still investigating on it to find out the root cause.
>>>>
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,504]  INFO
>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>> Monitor scheduled: [type] cluster [component]
>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,504] DEBUG
>>>> {org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
>>>> ClusterMonitor task interval set to : [application-id] null [cluster]
>>>> group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
>>>> [monitor-interval] 90000
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,504]  INFO
>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>> Starting monitor: [type] cluster [component]
>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,504] ERROR
>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
>>>> error occurred while starting monitor: [type] group [component]
>>>> my-group6-group-tom2-group-startup-order-test
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> java.lang.NullPointerException
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>     at
>>>> org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>     at
>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>     at
>>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>     at
>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>     at
>>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>     at
>>>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>     at
>>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>     at
>>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>     at
>>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>     at java.lang.Thread.run(Thread.java:745)
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,505] DEBUG
>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>> monitor is running: [group] my-group6-group-tom2-group-startup-order-test
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,504] DEBUG
>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>> -  Instance expiry time is set to: 900000
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,505] DEBUG
>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>> -  Instance obsolete expiry time is set to: 86400000
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,505] DEBUG
>>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>>> -  Instance pending termination expiry time is set to: 1800000
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,505]  INFO
>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
>>>> [Partition] partition-1has been added for the [Group]
>>>> my-group9-group-startup-order-test
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,505]  INFO
>>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>>> Monitor started successfully: [type] group [component]
>>>> my-group6-group-tom2-group-startup-order-test [dependents] none
>>>> [startup-time] 0 seconds
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,505]  INFO
>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>>> [Instance context] group-startup-order-test-1 has been added to [Group]
>>>> my-group9-group-startup-order-test
>>>> 2015-10-08 13:49:52 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:49:52,505]  INFO
>>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
>>>> the dependencies for the [Group] my-group9-group-startup-order-test
>>>>
>>>> --------------------------------------
>>>>
>>>> 2015-10-08 13:51:19 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:51:19,100] DEBUG
>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>> -  Checking the status of cluster
>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>> instance status is: Active
>>>> 2015-10-08 13:51:19 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:51:19,100] DEBUG
>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>>> -  Checking the status of cluster
>>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>>> instance status is: Active
>>>> 2015-10-08 13:51:19 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:51:19,100] DEBUG
>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>> Write lock released
>>>> 2015-10-08 13:51:19 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:51:19,100]  INFO
>>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
>>>> -  Sending group instance active for [group]
>>>> my-group6-group-tom2-group-startup-order-test [instance]
>>>> group-startup-order-test-1
>>>> 2015-10-08 13:51:19 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:51:19,100] DEBUG
>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>> Handling group activation for the [group-id]:
>>>> my-group6-group-tom2-group-startup-order-test in the [application-id]
>>>> group-startup-order-test [instance] group-startup-order-test-1
>>>> 2015-10-08 13:51:19 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:51:19,100] DEBUG
>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>> Write lock acquired
>>>> 2015-10-08 13:51:19 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:51:19,100]  WARN
>>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>>> Group monitor cannot be found: [group-id]
>>>> my-group6-group-tom2-group-startup-order-test [application-id]
>>>> group-startup-order-test
>>>> 2015-10-08 13:51:19 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:51:19,100]  INFO
>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
>>>> Cluster activated adding status started for
>>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>>> 2015-10-08 13:51:19 INFO
>>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-08 13:51:19,100] DEBUG
>>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>>> Updating topology
>>>>
>>>> Thanks,
>>>> Reka
>>>>
>>>>
>>>> On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <re...@wso2.com>
>>>> wrote:
>>>>
>>>>> Hi Akila
>>>>>
>>>>> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <
>>>>> ravihansa@wso2.com> wrote:
>>>>>
>>>>>> Hi Thanuja,
>>>>>>
>>>>>> I was referring to the build fail in [1]. Please see line starting
>>>>>> from:
>>>>>>
>>>>>> 2015-10-02 07:28:32 INFO
>>>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>>> [2015-10-02 07:28:32,834] ERROR
>>>>>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>>>>>> instance
>>>>>>
>>>>>> I think this is a separate issue that occurs very rarely. As you
>>>>>> noticed, NPE in GroupMonitor occurs when undeploying applications. The
>>>>>> problem is group monitors are retrieving the status from other group
>>>>>> monitor objects.
>>>>>>
>>>>>> @Reka: shall we change that logic to read the application status from
>>>>>> topology or ApplicationHolder instead of reading from monitors?
>>>>>>
>>>>>
>>>>> We can't read the Application status from Topology as Application will
>>>>> not contain any status rather only application instance will contain the
>>>>> status. By accessing application instance, we can't identify whether
>>>>> undeployment or force undeployment is in-progress. Hence we will have to
>>>>> maintain these flags to ApplicationMonitor to identity the undeployment or
>>>>> force undeployment. All other status are actually referring from the
>>>>> Topology.
>>>>>
>>>>> Thanks,
>>>>> Reka
>>>>>
>>>>>>
>>>>>> [1]
>>>>>> https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Reka Thirunavukkarasu
>>>>> Senior Software Engineer,
>>>>> WSO2, Inc.:http://wso2.com,
>>>>> Mobile: +94776442007
>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> Reka Thirunavukkarasu
>>>> Senior Software Engineer,
>>>> WSO2, Inc.:http://wso2.com,
>>>> Mobile: +94776442007
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Senior Technical Lead, WSO2
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Akila Ravihansa Perera
>> WSO2 Inc.;  http://wso2.com/
>>
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
>
> Gayan Gunarathne
> Technical Lead, WSO2 Inc. (http://wso2.com)
> Committer & PMC Member, Apache Stratos
> email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>
>
>
>



-- 
Thanuja Uruththirakodeeswaran
Software Engineer
WSO2 Inc.;http://wso2.com
lean.enterprise.middleware

mobile: +94 774363167

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Gayan Gunarathne <ga...@wso2.com>.
Seems even application is terminated, some of the group monitors are still
running. Mostly in the nested group scenario. Those group monitors looking
for the application monitor that didn't exist at that time.So I think we
need to recheck the logic of group monitor termination logic in the
application un-deployment. Will check further on this.

2015-10-11 18:15:07 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
Exception in thread "pool-39-thread-36" java.lang.NullPointerException
2015-10-11 18:15:07 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
2015-10-11 18:15:07 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
2015-10-11 18:15:07 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
2015-10-11 18:15:07 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -  at
java.lang.Thread.run(Thread.java:744)
2015-10-11 18:15:07 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-11 18:15:07,285] DEBUG
{org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
monitor is running: [group] my-group6-group-startup-order-test

Thanks,
Gayan

On Sat, Oct 10, 2015 at 3:35 PM, Akila Ravihansa Perera <ra...@wso2.com>
wrote:

> This is occurring frequently even in local build. I think this is a
> blocker for 4.1.4 release.
>
> On Fri, Oct 9, 2015 at 9:20 PM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> Thanks Reka! It is important to identify the root cause of this issue.
>> I'm also looking in.
>>
>> On Thu, Oct 8, 2015 at 6:13 PM, Reka Thirunavukkarasu <re...@wso2.com>
>> wrote:
>>
>>> Hi
>>>
>>> After going through the logs of integration, please find the break down
>>> as below. For my-group6-group-tom2-group-startup-order-test, it seems
>>> that the Adder got triggered twice or somehow monitor creation got
>>> triggered twice which cause the memory to inconsistent state. Hence the
>>> particular GroupMonitor got removed somehow. So that the application
>>> hierarchy was incomplete and application was unable to become active. I'm
>>> still investigating on it to find out the root cause.
>>>
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,504]  INFO
>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>> Monitor scheduled: [type] cluster [component]
>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,504] DEBUG
>>> {org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
>>> ClusterMonitor task interval set to : [application-id] null [cluster]
>>> group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
>>> [monitor-interval] 90000
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,504]  INFO
>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>> Starting monitor: [type] cluster [component]
>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,504] ERROR
>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
>>> error occurred while starting monitor: [type] group [component]
>>> my-group6-group-tom2-group-startup-order-test
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> java.lang.NullPointerException
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>     at
>>> org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>     at
>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>     at
>>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>     at
>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>     at
>>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>     at
>>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>     at
>>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>     at
>>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>     at
>>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>     at java.lang.Thread.run(Thread.java:745)
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,505] DEBUG
>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>> monitor is running: [group] my-group6-group-tom2-group-startup-order-test
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,504] DEBUG
>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>> -  Instance expiry time is set to: 900000
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,505] DEBUG
>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>> -  Instance obsolete expiry time is set to: 86400000
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,505] DEBUG
>>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>>> -  Instance pending termination expiry time is set to: 1800000
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,505]  INFO
>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
>>> [Partition] partition-1has been added for the [Group]
>>> my-group9-group-startup-order-test
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,505]  INFO
>>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>>> Monitor started successfully: [type] group [component]
>>> my-group6-group-tom2-group-startup-order-test [dependents] none
>>> [startup-time] 0 seconds
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,505]  INFO
>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>>> [Instance context] group-startup-order-test-1 has been added to [Group]
>>> my-group9-group-startup-order-test
>>> 2015-10-08 13:49:52 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:49:52,505]  INFO
>>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
>>> the dependencies for the [Group] my-group9-group-startup-order-test
>>>
>>> --------------------------------------
>>>
>>> 2015-10-08 13:51:19 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:51:19,100] DEBUG
>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>> -  Checking the status of cluster
>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>> instance status is: Active
>>> 2015-10-08 13:51:19 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:51:19,100] DEBUG
>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>>> -  Checking the status of cluster
>>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>>> instance status is: Active
>>> 2015-10-08 13:51:19 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:51:19,100] DEBUG
>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>> Write lock released
>>> 2015-10-08 13:51:19 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:51:19,100]  INFO
>>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
>>> -  Sending group instance active for [group]
>>> my-group6-group-tom2-group-startup-order-test [instance]
>>> group-startup-order-test-1
>>> 2015-10-08 13:51:19 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:51:19,100] DEBUG
>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>> Handling group activation for the [group-id]:
>>> my-group6-group-tom2-group-startup-order-test in the [application-id]
>>> group-startup-order-test [instance] group-startup-order-test-1
>>> 2015-10-08 13:51:19 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:51:19,100] DEBUG
>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>> Write lock acquired
>>> 2015-10-08 13:51:19 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:51:19,100]  WARN
>>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>>> Group monitor cannot be found: [group-id]
>>> my-group6-group-tom2-group-startup-order-test [application-id]
>>> group-startup-order-test
>>> 2015-10-08 13:51:19 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:51:19,100]  INFO
>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
>>> Cluster activated adding status started for
>>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>>> 2015-10-08 13:51:19 INFO
>>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-08 13:51:19,100] DEBUG
>>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>>> Updating topology
>>>
>>> Thanks,
>>> Reka
>>>
>>>
>>> On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <re...@wso2.com>
>>> wrote:
>>>
>>>> Hi Akila
>>>>
>>>> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <
>>>> ravihansa@wso2.com> wrote:
>>>>
>>>>> Hi Thanuja,
>>>>>
>>>>> I was referring to the build fail in [1]. Please see line starting
>>>>> from:
>>>>>
>>>>> 2015-10-02 07:28:32 INFO
>>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>>> [2015-10-02 07:28:32,834] ERROR
>>>>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>>>>> instance
>>>>>
>>>>> I think this is a separate issue that occurs very rarely. As you
>>>>> noticed, NPE in GroupMonitor occurs when undeploying applications. The
>>>>> problem is group monitors are retrieving the status from other group
>>>>> monitor objects.
>>>>>
>>>>> @Reka: shall we change that logic to read the application status from
>>>>> topology or ApplicationHolder instead of reading from monitors?
>>>>>
>>>>
>>>> We can't read the Application status from Topology as Application will
>>>> not contain any status rather only application instance will contain the
>>>> status. By accessing application instance, we can't identify whether
>>>> undeployment or force undeployment is in-progress. Hence we will have to
>>>> maintain these flags to ApplicationMonitor to identity the undeployment or
>>>> force undeployment. All other status are actually referring from the
>>>> Topology.
>>>>
>>>> Thanks,
>>>> Reka
>>>>
>>>>>
>>>>> [1]
>>>>> https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>>>>
>>>>> Thanks.
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Reka Thirunavukkarasu
>>>> Senior Software Engineer,
>>>> WSO2, Inc.:http://wso2.com,
>>>> Mobile: +94776442007
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Reka Thirunavukkarasu
>>> Senior Software Engineer,
>>> WSO2, Inc.:http://wso2.com,
>>> Mobile: +94776442007
>>>
>>>
>>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Senior Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
>
> --
> Akila Ravihansa Perera
> WSO2 Inc.;  http://wso2.com/
>
> Blog: http://ravihansa3000.blogspot.com
>



-- 

Gayan Gunarathne
Technical Lead, WSO2 Inc. (http://wso2.com)
Committer & PMC Member, Apache Stratos
email : gayang@wso2.com  | mobile : +94 775030545 <%2B94%20766819985>

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
This is occurring frequently even in local build. I think this is a blocker
for 4.1.4 release.

On Fri, Oct 9, 2015 at 9:20 PM, Imesh Gunaratne <im...@apache.org> wrote:

> Thanks Reka! It is important to identify the root cause of this issue. I'm
> also looking in.
>
> On Thu, Oct 8, 2015 at 6:13 PM, Reka Thirunavukkarasu <re...@wso2.com>
> wrote:
>
>> Hi
>>
>> After going through the logs of integration, please find the break down
>> as below. For my-group6-group-tom2-group-startup-order-test, it seems
>> that the Adder got triggered twice or somehow monitor creation got
>> triggered twice which cause the memory to inconsistent state. Hence the
>> particular GroupMonitor got removed somehow. So that the application
>> hierarchy was incomplete and application was unable to become active. I'm
>> still investigating on it to find out the root cause.
>>
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,504]  INFO
>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>> Monitor scheduled: [type] cluster [component]
>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,504] DEBUG
>> {org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
>> ClusterMonitor task interval set to : [application-id] null [cluster]
>> group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
>> [monitor-interval] 90000
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,504]  INFO
>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>> Starting monitor: [type] cluster [component]
>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,504] ERROR
>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
>> error occurred while starting monitor: [type] group [component]
>> my-group6-group-tom2-group-startup-order-test
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> java.lang.NullPointerException
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>     at
>> org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>     at
>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>     at
>> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>     at
>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>     at
>> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>     at
>> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>     at
>> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>     at
>> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>     at
>> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>     at java.lang.Thread.run(Thread.java:745)
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,505] DEBUG
>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>> monitor is running: [group] my-group6-group-tom2-group-startup-order-test
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,504] DEBUG
>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>> -  Instance expiry time is set to: 900000
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,505] DEBUG
>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>> -  Instance obsolete expiry time is set to: 86400000
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,505] DEBUG
>> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
>> -  Instance pending termination expiry time is set to: 1800000
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,505]  INFO
>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
>> [Partition] partition-1has been added for the [Group]
>> my-group9-group-startup-order-test
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,505]  INFO
>> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
>> Monitor started successfully: [type] group [component]
>> my-group6-group-tom2-group-startup-order-test [dependents] none
>> [startup-time] 0 seconds
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,505]  INFO
>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
>> [Instance context] group-startup-order-test-1 has been added to [Group]
>> my-group9-group-startup-order-test
>> 2015-10-08 13:49:52 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:49:52,505]  INFO
>> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
>> the dependencies for the [Group] my-group9-group-startup-order-test
>>
>> --------------------------------------
>>
>> 2015-10-08 13:51:19 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:51:19,100] DEBUG
>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>> -  Checking the status of cluster
>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>> instance status is: Active
>> 2015-10-08 13:51:19 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:51:19,100] DEBUG
>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
>> -  Checking the status of cluster
>> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
>> instance status is: Active
>> 2015-10-08 13:51:19 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:51:19,100] DEBUG
>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>> Write lock released
>> 2015-10-08 13:51:19 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:51:19,100]  INFO
>> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
>> -  Sending group instance active for [group]
>> my-group6-group-tom2-group-startup-order-test [instance]
>> group-startup-order-test-1
>> 2015-10-08 13:51:19 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:51:19,100] DEBUG
>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>> Handling group activation for the [group-id]:
>> my-group6-group-tom2-group-startup-order-test in the [application-id]
>> group-startup-order-test [instance] group-startup-order-test-1
>> 2015-10-08 13:51:19 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:51:19,100] DEBUG
>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>> Write lock acquired
>> 2015-10-08 13:51:19 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:51:19,100]  WARN
>> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
>> Group monitor cannot be found: [group-id]
>> my-group6-group-tom2-group-startup-order-test [application-id]
>> group-startup-order-test
>> 2015-10-08 13:51:19 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:51:19,100]  INFO
>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
>> Cluster activated adding status started for
>> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
>> 2015-10-08 13:51:19 INFO
>> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-08 13:51:19,100] DEBUG
>> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
>> Updating topology
>>
>> Thanks,
>> Reka
>>
>>
>> On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <re...@wso2.com>
>> wrote:
>>
>>> Hi Akila
>>>
>>> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <
>>> ravihansa@wso2.com> wrote:
>>>
>>>> Hi Thanuja,
>>>>
>>>> I was referring to the build fail in [1]. Please see line starting from:
>>>>
>>>> 2015-10-02 07:28:32 INFO
>>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>>> [2015-10-02 07:28:32,834] ERROR
>>>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>>>> instance
>>>>
>>>> I think this is a separate issue that occurs very rarely. As you
>>>> noticed, NPE in GroupMonitor occurs when undeploying applications. The
>>>> problem is group monitors are retrieving the status from other group
>>>> monitor objects.
>>>>
>>>> @Reka: shall we change that logic to read the application status from
>>>> topology or ApplicationHolder instead of reading from monitors?
>>>>
>>>
>>> We can't read the Application status from Topology as Application will
>>> not contain any status rather only application instance will contain the
>>> status. By accessing application instance, we can't identify whether
>>> undeployment or force undeployment is in-progress. Hence we will have to
>>> maintain these flags to ApplicationMonitor to identity the undeployment or
>>> force undeployment. All other status are actually referring from the
>>> Topology.
>>>
>>> Thanks,
>>> Reka
>>>
>>>>
>>>> [1]
>>>> https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>>>
>>>> Thanks.
>>>>
>>>
>>>
>>>
>>> --
>>> Reka Thirunavukkarasu
>>> Senior Software Engineer,
>>> WSO2, Inc.:http://wso2.com,
>>> Mobile: +94776442007
>>>
>>>
>>>
>>
>>
>> --
>> Reka Thirunavukkarasu
>> Senior Software Engineer,
>> WSO2, Inc.:http://wso2.com,
>> Mobile: +94776442007
>>
>>
>>
>
>
> --
> Imesh Gunaratne
>
> Senior Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>



-- 
Akila Ravihansa Perera
WSO2 Inc.;  http://wso2.com/

Blog: http://ravihansa3000.blogspot.com

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Imesh Gunaratne <im...@apache.org>.
Thanks Reka! It is important to identify the root cause of this issue. I'm
also looking in.

On Thu, Oct 8, 2015 at 6:13 PM, Reka Thirunavukkarasu <re...@wso2.com> wrote:

> Hi
>
> After going through the logs of integration, please find the break down as
> below. For my-group6-group-tom2-group-startup-order-test, it seems that
> the Adder got triggered twice or somehow monitor creation got triggered
> twice which cause the memory to inconsistent state. Hence the particular
> GroupMonitor got removed somehow. So that the application hierarchy was
> incomplete and application was unable to become active. I'm still
> investigating on it to find out the root cause.
>
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,504]  INFO
> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
> Monitor scheduled: [type] cluster [component]
> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,504] DEBUG
> {org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
> ClusterMonitor task interval set to : [application-id] null [cluster]
> group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
> [monitor-interval] 90000
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,504]  INFO
> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
> Starting monitor: [type] cluster [component]
> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,504] ERROR
> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
> error occurred while starting monitor: [type] group [component]
> my-group6-group-tom2-group-startup-order-test
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> java.lang.NullPointerException
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>     at
> org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>     at
> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>     at
> org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>     at
> org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>     at
> org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>     at
> org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>     at
> java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>     at java.util.concurrent.FutureTask.run(FutureTask.java:262)
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>     at
> java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>     at
> java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>     at java.lang.Thread.run(Thread.java:745)
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,505] DEBUG
> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
> monitor is running: [group] my-group6-group-tom2-group-startup-order-test
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,504] DEBUG
> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
> -  Instance expiry time is set to: 900000
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,505] DEBUG
> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
> -  Instance obsolete expiry time is set to: 86400000
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,505] DEBUG
> {org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
> -  Instance pending termination expiry time is set to: 1800000
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,505]  INFO
> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
> [Partition] partition-1has been added for the [Group]
> my-group9-group-startup-order-test
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,505]  INFO
> {org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
> Monitor started successfully: [type] group [component]
> my-group6-group-tom2-group-startup-order-test [dependents] none
> [startup-time] 0 seconds
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,505]  INFO
> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
> [Instance context] group-startup-order-test-1 has been added to [Group]
> my-group9-group-startup-order-test
> 2015-10-08 13:49:52 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:49:52,505]  INFO
> {org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
> the dependencies for the [Group] my-group9-group-startup-order-test
>
> --------------------------------------
>
> 2015-10-08 13:51:19 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:51:19,100] DEBUG
> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
> -  Checking the status of cluster
> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
> instance status is: Active
> 2015-10-08 13:51:19 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:51:19,100] DEBUG
> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
> -  Checking the status of cluster
> group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
> instance status is: Active
> 2015-10-08 13:51:19 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:51:19,100] DEBUG
> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
> Write lock released
> 2015-10-08 13:51:19 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:51:19,100]  INFO
> {org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
> -  Sending group instance active for [group]
> my-group6-group-tom2-group-startup-order-test [instance]
> group-startup-order-test-1
> 2015-10-08 13:51:19 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:51:19,100] DEBUG
> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
> Handling group activation for the [group-id]:
> my-group6-group-tom2-group-startup-order-test in the [application-id]
> group-startup-order-test [instance] group-startup-order-test-1
> 2015-10-08 13:51:19 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:51:19,100] DEBUG
> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
> Write lock acquired
> 2015-10-08 13:51:19 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:51:19,100]  WARN
> {org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
> Group monitor cannot be found: [group-id]
> my-group6-group-tom2-group-startup-order-test [application-id]
> group-startup-order-test
> 2015-10-08 13:51:19 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:51:19,100]  INFO
> {org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
> Cluster activated adding status started for
> group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
> 2015-10-08 13:51:19 INFO
> {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-08 13:51:19,100] DEBUG
> {org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
> Updating topology
>
> Thanks,
> Reka
>
>
> On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <re...@wso2.com>
> wrote:
>
>> Hi Akila
>>
>> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <
>> ravihansa@wso2.com> wrote:
>>
>>> Hi Thanuja,
>>>
>>> I was referring to the build fail in [1]. Please see line starting from:
>>>
>>> 2015-10-02 07:28:32 INFO
>>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>>> [2015-10-02 07:28:32,834] ERROR
>>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>>> instance
>>>
>>> I think this is a separate issue that occurs very rarely. As you
>>> noticed, NPE in GroupMonitor occurs when undeploying applications. The
>>> problem is group monitors are retrieving the status from other group
>>> monitor objects.
>>>
>>> @Reka: shall we change that logic to read the application status from
>>> topology or ApplicationHolder instead of reading from monitors?
>>>
>>
>> We can't read the Application status from Topology as Application will
>> not contain any status rather only application instance will contain the
>> status. By accessing application instance, we can't identify whether
>> undeployment or force undeployment is in-progress. Hence we will have to
>> maintain these flags to ApplicationMonitor to identity the undeployment or
>> force undeployment. All other status are actually referring from the
>> Topology.
>>
>> Thanks,
>> Reka
>>
>>>
>>> [1]
>>> https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>>
>>> Thanks.
>>>
>>
>>
>>
>> --
>> Reka Thirunavukkarasu
>> Senior Software Engineer,
>> WSO2, Inc.:http://wso2.com,
>> Mobile: +94776442007
>>
>>
>>
>
>
> --
> Reka Thirunavukkarasu
> Senior Software Engineer,
> WSO2, Inc.:http://wso2.com,
> Mobile: +94776442007
>
>
>


-- 
Imesh Gunaratne

Senior Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Reka Thirunavukkarasu <re...@wso2.com>.
Hi

After going through the logs of integration, please find the break down as
below. For my-group6-group-tom2-group-startup-order-test, it seems that the
Adder got triggered twice or somehow monitor creation got triggered twice
which cause the memory to inconsistent state. Hence the particular
GroupMonitor got removed somehow. So that the application hierarchy was
incomplete and application was unable to become active. I'm still
investigating on it to find out the root cause.

2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,504]  INFO
{org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
Monitor scheduled: [type] cluster [component]
group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,504] DEBUG
{org.apache.stratos.autoscaler.monitor.cluster.ClusterMonitor} -
ClusterMonitor task interval set to : [application-id] null [cluster]
group-startup-order-test.my-group7-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
[monitor-interval] 90000
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,504]  INFO
{org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
Starting monitor: [type] cluster [component]
group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,504] ERROR
{org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -  An
error occurred while starting monitor: [type] group [component]
my-group6-group-tom2-group-startup-order-test
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
java.lang.NullPointerException
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
    at
org.apache.stratos.autoscaler.monitor.Monitor.addInstance(Monitor.java:149)
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
    at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createGroupInstanceAndAddToMonitor(GroupMonitor.java:816)
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
    at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor.createInstanceAndStartDependencyAtStartup(GroupMonitor.java:898)
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
    at
org.apache.stratos.autoscaler.monitor.MonitorFactory.getGroupMonitor(MonitorFactory.java:161)
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
    at
org.apache.stratos.autoscaler.monitor.MonitorFactory.getMonitor(MonitorFactory.java:81)
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
    at
org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor$MonitorAdder.run(ParentComponentMonitor.java:1001)
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
    at
java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:471)
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
    at java.util.concurrent.FutureTask.run(FutureTask.java:262)
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
    at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
    at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
    at java.lang.Thread.run(Thread.java:745)
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,505] DEBUG
{org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
monitor is running: [group] my-group6-group-tom2-group-startup-order-test
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,504] DEBUG
{org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
-  Instance expiry time is set to: 900000
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,505] DEBUG
{org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
-  Instance obsolete expiry time is set to: 86400000
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,505] DEBUG
{org.apache.stratos.autoscaler.context.partition.ParentLevelPartitionContext}
-  Instance pending termination expiry time is set to: 1800000
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,505]  INFO
{org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -
[Partition] partition-1has been added for the [Group]
my-group9-group-startup-order-test
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,505]  INFO
{org.apache.stratos.autoscaler.monitor.component.ParentComponentMonitor} -
Monitor started successfully: [type] group [component]
my-group6-group-tom2-group-startup-order-test [dependents] none
[startup-time] 0 seconds
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,505]  INFO
{org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
[Instance context] group-startup-order-test-1 has been added to [Group]
my-group9-group-startup-order-test
2015-10-08 13:49:52 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:49:52,505]  INFO
{org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Starting
the dependencies for the [Group] my-group9-group-startup-order-test

--------------------------------------

2015-10-08 13:51:19 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:51:19,100] DEBUG
{org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
-  Checking the status of cluster
group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
instance status is: Active
2015-10-08 13:51:19 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:51:19,100] DEBUG
{org.apache.stratos.autoscaler.status.processor.group.GroupStatusProcessor}
-  Checking the status of cluster
group-startup-order-test.my-group-tom2-tomcat2-group-startup-order-test.tomcat2-group-startup-order-test.domain
instance status is: Active
2015-10-08 13:51:19 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:51:19,100] DEBUG
{org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
Write lock released
2015-10-08 13:51:19 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:51:19,100]  INFO
{org.apache.stratos.autoscaler.status.processor.group.GroupStatusActiveProcessor}
-  Sending group instance active for [group]
my-group6-group-tom2-group-startup-order-test [instance]
group-startup-order-test-1
2015-10-08 13:51:19 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:51:19,100] DEBUG
{org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
Handling group activation for the [group-id]:
my-group6-group-tom2-group-startup-order-test in the [application-id]
group-startup-order-test [instance] group-startup-order-test-1
2015-10-08 13:51:19 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:51:19,100] DEBUG
{org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
Write lock acquired
2015-10-08 13:51:19 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:51:19,100]  WARN
{org.apache.stratos.autoscaler.applications.topic.ApplicationBuilder} -
Group monitor cannot be found: [group-id]
my-group6-group-tom2-group-startup-order-test [application-id]
group-startup-order-test
2015-10-08 13:51:19 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:51:19,100]  INFO
{org.apache.stratos.cloud.controller.messaging.topology.TopologyBuilder} -
Cluster activated adding status started for
group-startup-order-test.my-group-tom2-tomcat3-group-startup-order-test.tomcat3-group-startup-order-test.domain
2015-10-08 13:51:19 INFO
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:51:19,100] DEBUG
{org.apache.stratos.cloud.controller.messaging.topology.TopologyManager} -
Updating topology

Thanks,
Reka


On Thu, Oct 8, 2015 at 4:47 PM, Reka Thirunavukkarasu <re...@wso2.com> wrote:

> Hi Akila
>
> On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <ravihansa@wso2.com
> > wrote:
>
>> Hi Thanuja,
>>
>> I was referring to the build fail in [1]. Please see line starting from:
>>
>> 2015-10-02 07:28:32 INFO
>>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
>> [2015-10-02 07:28:32,834] ERROR
>> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
>> instance
>>
>> I think this is a separate issue that occurs very rarely. As you noticed,
>> NPE in GroupMonitor occurs when undeploying applications. The problem is
>> group monitors are retrieving the status from other group monitor objects.
>>
>> @Reka: shall we change that logic to read the application status from
>> topology or ApplicationHolder instead of reading from monitors?
>>
>
> We can't read the Application status from Topology as Application will not
> contain any status rather only application instance will contain the
> status. By accessing application instance, we can't identify whether
> undeployment or force undeployment is in-progress. Hence we will have to
> maintain these flags to ApplicationMonitor to identity the undeployment or
> force undeployment. All other status are actually referring from the
> Topology.
>
> Thanks,
> Reka
>
>>
>> [1] https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>>
>> Thanks.
>>
>
>
>
> --
> Reka Thirunavukkarasu
> Senior Software Engineer,
> WSO2, Inc.:http://wso2.com,
> Mobile: +94776442007
>
>
>


-- 
Reka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +94776442007

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Reka Thirunavukkarasu <re...@wso2.com>.
Hi Akila

On Thu, Oct 8, 2015 at 2:51 PM, Akila Ravihansa Perera <ra...@wso2.com>
wrote:

> Hi Thanuja,
>
> I was referring to the build fail in [1]. Please see line starting from:
>
> 2015-10-02 07:28:32 INFO
>  {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
> [2015-10-02 07:28:32,834] ERROR
> {org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
> instance
>
> I think this is a separate issue that occurs very rarely. As you noticed,
> NPE in GroupMonitor occurs when undeploying applications. The problem is
> group monitors are retrieving the status from other group monitor objects.
>
> @Reka: shall we change that logic to read the application status from
> topology or ApplicationHolder instead of reading from monitors?
>

We can't read the Application status from Topology as Application will not
contain any status rather only application instance will contain the
status. By accessing application instance, we can't identify whether
undeployment or force undeployment is in-progress. Hence we will have to
maintain these flags to ApplicationMonitor to identity the undeployment or
force undeployment. All other status are actually referring from the
Topology.

Thanks,
Reka

>
> [1] https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull
>
> Thanks.
>



-- 
Reka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +94776442007

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
Hi Thanuja,

I was referring to the build fail in [1]. Please see line starting from:

2015-10-02 07:28:32 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-02 07:28:32,834] ERROR
{org.apache.stratos.autoscaler.rule.RuleTasksDelegator} -  Cannot terminate
instance

I think this is a separate issue that occurs very rarely. As you noticed,
NPE in GroupMonitor occurs when undeploying applications. The problem is
group monitors are retrieving the status from other group monitor objects.

@Reka: shall we change that logic to read the application status from
topology or ApplicationHolder instead of reading from monitors?

[1] https://builds.apache.org/job/Stratos-41x-Commit-Build/68/consoleFull

Thanks.

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Thanuja Uruththirakodeeswaran <th...@wso2.com>.
Hi All,

NPE is not thrown by drool files. I reverted the changes in drool file
which we did for metering service locally and ran the integration test. I'm
getting NPE in same place at GroupMonitor (line - 163) as follows:

2015-10-08 13:42:28 INFO
 {org.apache.stratos.integration.tests.application.SampleApplicationStartupTestCase}:150
- Waiting for application status to become INACTIVE
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,758] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  A cluster monitor is not found in autoscaler context [cluster]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,759] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  A cluster monitor is not found in autoscaler context [cluster]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,759] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  A cluster monitor is not found in autoscaler context [cluster]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,761] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  Member not found in the Topology: [member]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain5978c03c-0a2e-4023-8cd9-e7657c22c273
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,761] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  A cluster monitor is not found in autoscaler context [cluster]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,762] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  A cluster monitor is not found in autoscaler context [cluster]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,762] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  Member not found in the Topology: [member]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain5978c03c-0a2e-4023-8cd9-e7657c22c273
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,762] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  A cluster monitor is not found in autoscaler context [cluster]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,763] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  A cluster monitor is not found in autoscaler context [cluster]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,763] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  Member not found in the Topology: [member]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain5978c03c-0a2e-4023-8cd9-e7657c22c273
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,763] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  A cluster monitor is not found in autoscaler context [cluster]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,763] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  A cluster monitor is not found in autoscaler context [cluster]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,764] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  Member not found in the Topology: [member]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain5978c03c-0a2e-4023-8cd9-e7657c22c273
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,764] DEBUG
{org.apache.stratos.autoscaler.event.receiver.health.AutoscalerHealthStatEventReceiver}
-  Member not found in the Topology: [member]
group-startup-order-test.my-tomcat-group-startup-order-test.tomcat-group-startup-order-test.domain5978c03c-0a2e-4023-8cd9-e7657c22c273
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,828] DEBUG
{org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
monitor is running: [group] my-group6-group-startup-order-test
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
Exception in thread "pool-39-thread-93" java.lang.NullPointerException
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.lang.Thread.run(Thread.java:745)
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,852] DEBUG
{org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
monitor is running: [group] my-group8-group-startup-order-test
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
Exception in thread "pool-39-thread-99" java.lang.NullPointerException
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.lang.Thread.run(Thread.java:745)
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,889] DEBUG
{org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
monitor is running: [group] my-group9-group-startup-order-test
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
Exception in thread "pool-39-thread-100" java.lang.NullPointerException
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.lang.Thread.run(Thread.java:745)
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,918] DEBUG
{org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
monitor is running: [group] my-group6-group-tom2-group-startup-order-test
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
Exception in thread "pool-39-thread-97" java.lang.NullPointerException
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.lang.Thread.run(Thread.java:745)
2015-10-08 13:42:35 INFO
 {org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:70 -
[2015-10-08 13:42:35,941] DEBUG
{org.apache.stratos.autoscaler.monitor.component.GroupMonitor} -  Group
monitor is running: [group] my-group7-group-startup-order-test
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 -
Exception in thread "pool-39-thread-94" java.lang.NullPointerException
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
org.apache.stratos.autoscaler.monitor.component.GroupMonitor$1.run(GroupMonitor.java:163)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
2015-10-08 13:42:35 ERROR
{org.wso2.carbon.automation.extensions.servers.utils.ServerLogReader}:73 - at
java.lang.Thread.run(Thread.java:745)


So this NPE is thrown because of drool file changes and we need to debug
ApplicationMonitor and ClusterMonitor classes when undeploying application.

Thanks.

On Wed, Oct 7, 2015 at 10:07 PM, Reka Thirunavukkarasu <re...@wso2.com>
wrote:

> Hi Akila,
>
> On Wed, Oct 7, 2015 at 7:08 PM, Akila Ravihansa Perera <ravihansa@wso2.com
> > wrote:
>
>> Hi Reka,
>>
>> Could you please explain the fix that you are planning to do?
>>
> I have added only Null check to the places where Application Monitor was
> invoked. It is required as in the force undeployment, we are removing all
> the monitors without considering the monitor hierarchy.
>
>>
>> While going through the GroupMonitor class, few issues were found related
>> to the logic in handling Thread Executors. The problem is when an
>> application is undeployed, execution jobs are never stopped from Thread
>> Executor service. The jobs will keep running even after application is been
>> undeployed. Have we addressed this case in Thread Executors?
>>
>
> This is being handled in the ApplicationBuilder line 427, 302 and 306. We
> were stopping the monitor executor service using below code:
>
> /**
>      * This will stop the scheduler which is running for the monitor
>      */
>     protected void stopScheduler() {
>         schedulerFuture.cancel(true);
>     }
>
> If it is not working properly, then might need to check further on this.
> When stopScheduler is invoked, if the thread is started, then we don't have
> control over it. It will get executed for that iteration and then only it
> will get stopped. I have tried a simple sample with debug logs for monitor.
> I couldn't see the monitor thread after undeployment. Has this particular
> issue occurred during force undeployment?
>
>>
>> Also monitoringRunnable implementation does not catch any possible
>> exceptions. This is the reason why we are seeing NPE's in the console
>> output while running integration tests but not seeing them in
>> wso2carbon.log. I think we better catch a generic exception in
>> monitoringRunnable run method.
>>
>
> +1 for catching generic exception in monitoringRunnable.
>
> Thanks,
> Reka
>
>>
>> Thanks.
>>
>> On Wed, Oct 7, 2015 at 6:34 PM, Reka Thirunavukkarasu <re...@wso2.com>
>> wrote:
>>
>>> Hi Imesh,
>>>
>>> On Wed, Oct 7, 2015 at 7:27 AM, Reka Thirunavukkarasu <re...@wso2.com>
>>> wrote:
>>>
>>>> Hi Imesh,
>>>>
>>>> On Wed, Oct 7, 2015 at 5:46 AM, Imesh Gunaratne <im...@apache.org>
>>>> wrote:
>>>>
>>>>> GroupMonitor:
>>>>>
>>>>>       ApplicationMonitor applicationMonitor =
>>>>> AutoscalerContext.getInstance().
>>>>>                             getAppMonitor(appId);
>>>>>
>>>>> [161] //When the application is getting un-deployed, need to avoid
>>>>> [162] // checking the minimum count sanctification
>>>>> [163] if (!applicationMonitor.isTerminating()) {
>>>>>
>>>>> In GroupMonitor class the line number 163 is shown above, may be due
>>>>> to some reason application monitor is not found when executing the group
>>>>> monitor.
>>>>>
>>>>> @Reka: Do you have any thoughts on this?
>>>>>
>>>>
>>>> Yah..It could happen when force undeployment is invoked. I will check
>>>> on this..
>>>>
>>>
>>> I have fixed the possible places which could cause NPE by scanning
>>> through the code. I will do a quick round of testing and push the changes
>>> to Stratos-4.1.x branch.
>>>
>>> Thanks,
>>> Reka
>>>
>>>>
>>>> Thanks,
>>>> Reka
>>>>
>>>>>
>>>>> Thanks
>>>>>
>>>>> On Wed, Oct 7, 2015 at 1:20 AM, Thanuja Uruththirakodeeswaran <
>>>>> thanujau@wso2.com> wrote:
>>>>>
>>>>>> Hi Akila,
>>>>>>
>>>>>>
>>>>>> On Wed, Oct 7, 2015 at 1:09 AM, Akila Ravihansa Perera <
>>>>>> ravihansa@wso2.com> wrote:
>>>>>>
>>>>>>> Hi Thanuja,
>>>>>>>
>>>>>>> Thanks for the update.
>>>>>>>
>>>>>>> In both of those cases, did you observe any build failures? If so,
>>>>>>> what are the tests that failed?
>>>>>>>
>>>>>>
>>>>>> For the complete stratos build, following test cases are failing with
>>>>>> NPE in ClusterMonitor as shown above:
>>>>>> Failed tests:
>>>>>>   ApplicationBurstingTestCase.testApplicationBusting:138
>>>>>>   GroupStartupOrderTestCase.testTerminationBehavior:194 Application
>>>>>> status did not change to Active: [application-id] group-startup-order-test
>>>>>> expected:<Active> but was:<Inactive>
>>>>>>   SampleApplicationStartupTestCase.testApplication:103
>>>>>>   SampleApplicationsTestCase.testApplication:57 » Runtime
>>>>>>   SampleApplicationsTestCase.testApplicationList:252 » Runtime
>>>>>>
>>>>>> SingleClusterScalingTestCase.testDeployApplication:117->assertClusterWithScaleDown:260
>>>>>> » ThreadTimeout
>>>>>>
>>>>>> When running integration test only, there is no test failure and I'm
>>>>>> getting NPE in GroupMonitor class.
>>>>>>
>>>>>>>
>>>>>>> I noticed the same behavior as you have explained. When I check the
>>>>>>> log file
>>>>>>> in /test-integration/target/<carbon-home>/repository/logs/wso2carbon.log, I
>>>>>>> didn't see any NPE's related to Drool files. Only one NPE is thrown from
>>>>>>> GroupMonitor class. Can you check whether it is the same for you?
>>>>>>>
>>>>>>
>>>>>> Yes, if I ran integration test directly, NPE was thrown in
>>>>>> GroupMonitor class and no drools error were there.
>>>>>>
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>> On Wed, Oct 7, 2015 at 1:05 AM, Akila Ravihansa Perera <
>>>>>>> ravihansa@wso2.com> wrote:
>>>>>>>
>>>>>>>> Hi,
>>>>>>>>
>>>>>>>> It seems integration tests are failing intermittently regardless of
>>>>>>>> NPE's thrown from Drool files. I've added more debug logs to troubleshoot
>>>>>>>> the issue. I've set the default log level in AS and CC packages to DEBUG in
>>>>>>>> integration tests. This will help us to identify the root causes of
>>>>>>>> integration test failures in Jenkins build.
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>>
>>>>>>>>
>>>>>>>> On Tue, Oct 6, 2015 at 12:38 PM, Thanuja Uruththirakodeeswaran <
>>>>>>>> thanujau@wso2.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Akila,
>>>>>>>>>
>>>>>>>>> I'll check this and let you know.
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>>
>>>>>>>>> On Tue, Oct 6, 2015 at 12:31 PM, Akila Ravihansa Perera <
>>>>>>>>> ravihansa@wso2.com> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Thanuja,
>>>>>>>>>>
>>>>>>>>>> I noticed that integration tests are failing in stratos-4.1.x
>>>>>>>>>> branch due to an issue in Drools files. It seems there have been couple of
>>>>>>>>>> modifications done for Drools files with new metering dashboard feature.
>>>>>>>>>> Perhaps it is incompatible with autoscaler APIs. Could you look into that
>>>>>>>>>> please?
>>>>>>>>>>
>>>>>>>>>> Thanks.
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> Akila Ravihansa Perera
>>>>>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>>>>>
>>>>>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Thanuja Uruththirakodeeswaran
>>>>>>>>> Software Engineer
>>>>>>>>> WSO2 Inc.;http://wso2.com
>>>>>>>>> lean.enterprise.middleware
>>>>>>>>>
>>>>>>>>> mobile: +94 774363167
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Akila Ravihansa Perera
>>>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>>>
>>>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Akila Ravihansa Perera
>>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>>
>>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Thanuja Uruththirakodeeswaran
>>>>>> Software Engineer
>>>>>> WSO2 Inc.;http://wso2.com
>>>>>> lean.enterprise.middleware
>>>>>>
>>>>>> mobile: +94 774363167
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Imesh Gunaratne
>>>>>
>>>>> Senior Technical Lead, WSO2
>>>>> Committer & PMC Member, Apache Stratos
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Reka Thirunavukkarasu
>>>> Senior Software Engineer,
>>>> WSO2, Inc.:http://wso2.com,
>>>> Mobile: +94776442007
>>>>
>>>>
>>>>
>>>
>>>
>>> --
>>> Reka Thirunavukkarasu
>>> Senior Software Engineer,
>>> WSO2, Inc.:http://wso2.com,
>>> Mobile: +94776442007
>>>
>>>
>>>
>>
>>
>> --
>> Akila Ravihansa Perera
>> WSO2 Inc.;  http://wso2.com/
>>
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
> Reka Thirunavukkarasu
> Senior Software Engineer,
> WSO2, Inc.:http://wso2.com,
> Mobile: +94776442007
>
>
>


-- 
Thanuja Uruththirakodeeswaran
Software Engineer
WSO2 Inc.;http://wso2.com
lean.enterprise.middleware

mobile: +94 774363167

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Reka Thirunavukkarasu <re...@wso2.com>.
Hi Akila,

On Wed, Oct 7, 2015 at 7:08 PM, Akila Ravihansa Perera <ra...@wso2.com>
wrote:

> Hi Reka,
>
> Could you please explain the fix that you are planning to do?
>
I have added only Null check to the places where Application Monitor was
invoked. It is required as in the force undeployment, we are removing all
the monitors without considering the monitor hierarchy.

>
> While going through the GroupMonitor class, few issues were found related
> to the logic in handling Thread Executors. The problem is when an
> application is undeployed, execution jobs are never stopped from Thread
> Executor service. The jobs will keep running even after application is been
> undeployed. Have we addressed this case in Thread Executors?
>

This is being handled in the ApplicationBuilder line 427, 302 and 306. We
were stopping the monitor executor service using below code:

/**
     * This will stop the scheduler which is running for the monitor
     */
    protected void stopScheduler() {
        schedulerFuture.cancel(true);
    }

If it is not working properly, then might need to check further on this.
When stopScheduler is invoked, if the thread is started, then we don't have
control over it. It will get executed for that iteration and then only it
will get stopped. I have tried a simple sample with debug logs for monitor.
I couldn't see the monitor thread after undeployment. Has this particular
issue occurred during force undeployment?

>
> Also monitoringRunnable implementation does not catch any possible
> exceptions. This is the reason why we are seeing NPE's in the console
> output while running integration tests but not seeing them in
> wso2carbon.log. I think we better catch a generic exception in
> monitoringRunnable run method.
>

+1 for catching generic exception in monitoringRunnable.

Thanks,
Reka

>
> Thanks.
>
> On Wed, Oct 7, 2015 at 6:34 PM, Reka Thirunavukkarasu <re...@wso2.com>
> wrote:
>
>> Hi Imesh,
>>
>> On Wed, Oct 7, 2015 at 7:27 AM, Reka Thirunavukkarasu <re...@wso2.com>
>> wrote:
>>
>>> Hi Imesh,
>>>
>>> On Wed, Oct 7, 2015 at 5:46 AM, Imesh Gunaratne <im...@apache.org>
>>> wrote:
>>>
>>>> GroupMonitor:
>>>>
>>>>       ApplicationMonitor applicationMonitor =
>>>> AutoscalerContext.getInstance().
>>>>                             getAppMonitor(appId);
>>>>
>>>> [161] //When the application is getting un-deployed, need to avoid
>>>> [162] // checking the minimum count sanctification
>>>> [163] if (!applicationMonitor.isTerminating()) {
>>>>
>>>> In GroupMonitor class the line number 163 is shown above, may be due to
>>>> some reason application monitor is not found when executing the group
>>>> monitor.
>>>>
>>>> @Reka: Do you have any thoughts on this?
>>>>
>>>
>>> Yah..It could happen when force undeployment is invoked. I will check on
>>> this..
>>>
>>
>> I have fixed the possible places which could cause NPE by scanning
>> through the code. I will do a quick round of testing and push the changes
>> to Stratos-4.1.x branch.
>>
>> Thanks,
>> Reka
>>
>>>
>>> Thanks,
>>> Reka
>>>
>>>>
>>>> Thanks
>>>>
>>>> On Wed, Oct 7, 2015 at 1:20 AM, Thanuja Uruththirakodeeswaran <
>>>> thanujau@wso2.com> wrote:
>>>>
>>>>> Hi Akila,
>>>>>
>>>>>
>>>>> On Wed, Oct 7, 2015 at 1:09 AM, Akila Ravihansa Perera <
>>>>> ravihansa@wso2.com> wrote:
>>>>>
>>>>>> Hi Thanuja,
>>>>>>
>>>>>> Thanks for the update.
>>>>>>
>>>>>> In both of those cases, did you observe any build failures? If so,
>>>>>> what are the tests that failed?
>>>>>>
>>>>>
>>>>> For the complete stratos build, following test cases are failing with
>>>>> NPE in ClusterMonitor as shown above:
>>>>> Failed tests:
>>>>>   ApplicationBurstingTestCase.testApplicationBusting:138
>>>>>   GroupStartupOrderTestCase.testTerminationBehavior:194 Application
>>>>> status did not change to Active: [application-id] group-startup-order-test
>>>>> expected:<Active> but was:<Inactive>
>>>>>   SampleApplicationStartupTestCase.testApplication:103
>>>>>   SampleApplicationsTestCase.testApplication:57 » Runtime
>>>>>   SampleApplicationsTestCase.testApplicationList:252 » Runtime
>>>>>
>>>>> SingleClusterScalingTestCase.testDeployApplication:117->assertClusterWithScaleDown:260
>>>>> » ThreadTimeout
>>>>>
>>>>> When running integration test only, there is no test failure and I'm
>>>>> getting NPE in GroupMonitor class.
>>>>>
>>>>>>
>>>>>> I noticed the same behavior as you have explained. When I check the
>>>>>> log file
>>>>>> in /test-integration/target/<carbon-home>/repository/logs/wso2carbon.log, I
>>>>>> didn't see any NPE's related to Drool files. Only one NPE is thrown from
>>>>>> GroupMonitor class. Can you check whether it is the same for you?
>>>>>>
>>>>>
>>>>> Yes, if I ran integration test directly, NPE was thrown in
>>>>> GroupMonitor class and no drools error were there.
>>>>>
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> On Wed, Oct 7, 2015 at 1:05 AM, Akila Ravihansa Perera <
>>>>>> ravihansa@wso2.com> wrote:
>>>>>>
>>>>>>> Hi,
>>>>>>>
>>>>>>> It seems integration tests are failing intermittently regardless of
>>>>>>> NPE's thrown from Drool files. I've added more debug logs to troubleshoot
>>>>>>> the issue. I've set the default log level in AS and CC packages to DEBUG in
>>>>>>> integration tests. This will help us to identify the root causes of
>>>>>>> integration test failures in Jenkins build.
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>>
>>>>>>> On Tue, Oct 6, 2015 at 12:38 PM, Thanuja Uruththirakodeeswaran <
>>>>>>> thanujau@wso2.com> wrote:
>>>>>>>
>>>>>>>> Hi Akila,
>>>>>>>>
>>>>>>>> I'll check this and let you know.
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>>
>>>>>>>> On Tue, Oct 6, 2015 at 12:31 PM, Akila Ravihansa Perera <
>>>>>>>> ravihansa@wso2.com> wrote:
>>>>>>>>
>>>>>>>>> Hi Thanuja,
>>>>>>>>>
>>>>>>>>> I noticed that integration tests are failing in stratos-4.1.x
>>>>>>>>> branch due to an issue in Drools files. It seems there have been couple of
>>>>>>>>> modifications done for Drools files with new metering dashboard feature.
>>>>>>>>> Perhaps it is incompatible with autoscaler APIs. Could you look into that
>>>>>>>>> please?
>>>>>>>>>
>>>>>>>>> Thanks.
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> Akila Ravihansa Perera
>>>>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>>>>
>>>>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> Thanuja Uruththirakodeeswaran
>>>>>>>> Software Engineer
>>>>>>>> WSO2 Inc.;http://wso2.com
>>>>>>>> lean.enterprise.middleware
>>>>>>>>
>>>>>>>> mobile: +94 774363167
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Akila Ravihansa Perera
>>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>>
>>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Akila Ravihansa Perera
>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>
>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Thanuja Uruththirakodeeswaran
>>>>> Software Engineer
>>>>> WSO2 Inc.;http://wso2.com
>>>>> lean.enterprise.middleware
>>>>>
>>>>> mobile: +94 774363167
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Imesh Gunaratne
>>>>
>>>> Senior Technical Lead, WSO2
>>>> Committer & PMC Member, Apache Stratos
>>>>
>>>
>>>
>>>
>>> --
>>> Reka Thirunavukkarasu
>>> Senior Software Engineer,
>>> WSO2, Inc.:http://wso2.com,
>>> Mobile: +94776442007
>>>
>>>
>>>
>>
>>
>> --
>> Reka Thirunavukkarasu
>> Senior Software Engineer,
>> WSO2, Inc.:http://wso2.com,
>> Mobile: +94776442007
>>
>>
>>
>
>
> --
> Akila Ravihansa Perera
> WSO2 Inc.;  http://wso2.com/
>
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Reka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +94776442007

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
Hi Reka,

Could you please explain the fix that you are planning to do?

While going through the GroupMonitor class, few issues were found related
to the logic in handling Thread Executors. The problem is when an
application is undeployed, execution jobs are never stopped from Thread
Executor service. The jobs will keep running even after application is been
undeployed. Have we addressed this case in Thread Executors?

Also monitoringRunnable implementation does not catch any possible
exceptions. This is the reason why we are seeing NPE's in the console
output while running integration tests but not seeing them in
wso2carbon.log. I think we better catch a generic exception in
monitoringRunnable run method.

Thanks.

On Wed, Oct 7, 2015 at 6:34 PM, Reka Thirunavukkarasu <re...@wso2.com> wrote:

> Hi Imesh,
>
> On Wed, Oct 7, 2015 at 7:27 AM, Reka Thirunavukkarasu <re...@wso2.com>
> wrote:
>
>> Hi Imesh,
>>
>> On Wed, Oct 7, 2015 at 5:46 AM, Imesh Gunaratne <im...@apache.org> wrote:
>>
>>> GroupMonitor:
>>>
>>>       ApplicationMonitor applicationMonitor =
>>> AutoscalerContext.getInstance().
>>>                             getAppMonitor(appId);
>>>
>>> [161] //When the application is getting un-deployed, need to avoid
>>> [162] // checking the minimum count sanctification
>>> [163] if (!applicationMonitor.isTerminating()) {
>>>
>>> In GroupMonitor class the line number 163 is shown above, may be due to
>>> some reason application monitor is not found when executing the group
>>> monitor.
>>>
>>> @Reka: Do you have any thoughts on this?
>>>
>>
>> Yah..It could happen when force undeployment is invoked. I will check on
>> this..
>>
>
> I have fixed the possible places which could cause NPE by scanning through
> the code. I will do a quick round of testing and push the changes to
> Stratos-4.1.x branch.
>
> Thanks,
> Reka
>
>>
>> Thanks,
>> Reka
>>
>>>
>>> Thanks
>>>
>>> On Wed, Oct 7, 2015 at 1:20 AM, Thanuja Uruththirakodeeswaran <
>>> thanujau@wso2.com> wrote:
>>>
>>>> Hi Akila,
>>>>
>>>>
>>>> On Wed, Oct 7, 2015 at 1:09 AM, Akila Ravihansa Perera <
>>>> ravihansa@wso2.com> wrote:
>>>>
>>>>> Hi Thanuja,
>>>>>
>>>>> Thanks for the update.
>>>>>
>>>>> In both of those cases, did you observe any build failures? If so,
>>>>> what are the tests that failed?
>>>>>
>>>>
>>>> For the complete stratos build, following test cases are failing with
>>>> NPE in ClusterMonitor as shown above:
>>>> Failed tests:
>>>>   ApplicationBurstingTestCase.testApplicationBusting:138
>>>>   GroupStartupOrderTestCase.testTerminationBehavior:194 Application
>>>> status did not change to Active: [application-id] group-startup-order-test
>>>> expected:<Active> but was:<Inactive>
>>>>   SampleApplicationStartupTestCase.testApplication:103
>>>>   SampleApplicationsTestCase.testApplication:57 » Runtime
>>>>   SampleApplicationsTestCase.testApplicationList:252 » Runtime
>>>>
>>>> SingleClusterScalingTestCase.testDeployApplication:117->assertClusterWithScaleDown:260
>>>> » ThreadTimeout
>>>>
>>>> When running integration test only, there is no test failure and I'm
>>>> getting NPE in GroupMonitor class.
>>>>
>>>>>
>>>>> I noticed the same behavior as you have explained. When I check the
>>>>> log file
>>>>> in /test-integration/target/<carbon-home>/repository/logs/wso2carbon.log, I
>>>>> didn't see any NPE's related to Drool files. Only one NPE is thrown from
>>>>> GroupMonitor class. Can you check whether it is the same for you?
>>>>>
>>>>
>>>> Yes, if I ran integration test directly, NPE was thrown in GroupMonitor
>>>> class and no drools error were there.
>>>>
>>>>>
>>>>> Thanks.
>>>>>
>>>>> On Wed, Oct 7, 2015 at 1:05 AM, Akila Ravihansa Perera <
>>>>> ravihansa@wso2.com> wrote:
>>>>>
>>>>>> Hi,
>>>>>>
>>>>>> It seems integration tests are failing intermittently regardless of
>>>>>> NPE's thrown from Drool files. I've added more debug logs to troubleshoot
>>>>>> the issue. I've set the default log level in AS and CC packages to DEBUG in
>>>>>> integration tests. This will help us to identify the root causes of
>>>>>> integration test failures in Jenkins build.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>>
>>>>>> On Tue, Oct 6, 2015 at 12:38 PM, Thanuja Uruththirakodeeswaran <
>>>>>> thanujau@wso2.com> wrote:
>>>>>>
>>>>>>> Hi Akila,
>>>>>>>
>>>>>>> I'll check this and let you know.
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>> On Tue, Oct 6, 2015 at 12:31 PM, Akila Ravihansa Perera <
>>>>>>> ravihansa@wso2.com> wrote:
>>>>>>>
>>>>>>>> Hi Thanuja,
>>>>>>>>
>>>>>>>> I noticed that integration tests are failing in stratos-4.1.x
>>>>>>>> branch due to an issue in Drools files. It seems there have been couple of
>>>>>>>> modifications done for Drools files with new metering dashboard feature.
>>>>>>>> Perhaps it is incompatible with autoscaler APIs. Could you look into that
>>>>>>>> please?
>>>>>>>>
>>>>>>>> Thanks.
>>>>>>>>
>>>>>>>> --
>>>>>>>> Akila Ravihansa Perera
>>>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>>>
>>>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> Thanuja Uruththirakodeeswaran
>>>>>>> Software Engineer
>>>>>>> WSO2 Inc.;http://wso2.com
>>>>>>> lean.enterprise.middleware
>>>>>>>
>>>>>>> mobile: +94 774363167
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Akila Ravihansa Perera
>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>
>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Akila Ravihansa Perera
>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>
>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thanuja Uruththirakodeeswaran
>>>> Software Engineer
>>>> WSO2 Inc.;http://wso2.com
>>>> lean.enterprise.middleware
>>>>
>>>> mobile: +94 774363167
>>>>
>>>
>>>
>>>
>>> --
>>> Imesh Gunaratne
>>>
>>> Senior Technical Lead, WSO2
>>> Committer & PMC Member, Apache Stratos
>>>
>>
>>
>>
>> --
>> Reka Thirunavukkarasu
>> Senior Software Engineer,
>> WSO2, Inc.:http://wso2.com,
>> Mobile: +94776442007
>>
>>
>>
>
>
> --
> Reka Thirunavukkarasu
> Senior Software Engineer,
> WSO2, Inc.:http://wso2.com,
> Mobile: +94776442007
>
>
>


-- 
Akila Ravihansa Perera
WSO2 Inc.;  http://wso2.com/

Blog: http://ravihansa3000.blogspot.com

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Reka Thirunavukkarasu <re...@wso2.com>.
Hi Imesh,

On Wed, Oct 7, 2015 at 7:27 AM, Reka Thirunavukkarasu <re...@wso2.com> wrote:

> Hi Imesh,
>
> On Wed, Oct 7, 2015 at 5:46 AM, Imesh Gunaratne <im...@apache.org> wrote:
>
>> GroupMonitor:
>>
>>       ApplicationMonitor applicationMonitor =
>> AutoscalerContext.getInstance().
>>                             getAppMonitor(appId);
>>
>> [161] //When the application is getting un-deployed, need to avoid
>> [162] // checking the minimum count sanctification
>> [163] if (!applicationMonitor.isTerminating()) {
>>
>> In GroupMonitor class the line number 163 is shown above, may be due to
>> some reason application monitor is not found when executing the group
>> monitor.
>>
>> @Reka: Do you have any thoughts on this?
>>
>
> Yah..It could happen when force undeployment is invoked. I will check on
> this..
>

I have fixed the possible places which could cause NPE by scanning through
the code. I will do a quick round of testing and push the changes to
Stratos-4.1.x branch.

Thanks,
Reka

>
> Thanks,
> Reka
>
>>
>> Thanks
>>
>> On Wed, Oct 7, 2015 at 1:20 AM, Thanuja Uruththirakodeeswaran <
>> thanujau@wso2.com> wrote:
>>
>>> Hi Akila,
>>>
>>>
>>> On Wed, Oct 7, 2015 at 1:09 AM, Akila Ravihansa Perera <
>>> ravihansa@wso2.com> wrote:
>>>
>>>> Hi Thanuja,
>>>>
>>>> Thanks for the update.
>>>>
>>>> In both of those cases, did you observe any build failures? If so, what
>>>> are the tests that failed?
>>>>
>>>
>>> For the complete stratos build, following test cases are failing with
>>> NPE in ClusterMonitor as shown above:
>>> Failed tests:
>>>   ApplicationBurstingTestCase.testApplicationBusting:138
>>>   GroupStartupOrderTestCase.testTerminationBehavior:194 Application
>>> status did not change to Active: [application-id] group-startup-order-test
>>> expected:<Active> but was:<Inactive>
>>>   SampleApplicationStartupTestCase.testApplication:103
>>>   SampleApplicationsTestCase.testApplication:57 » Runtime
>>>   SampleApplicationsTestCase.testApplicationList:252 » Runtime
>>>
>>> SingleClusterScalingTestCase.testDeployApplication:117->assertClusterWithScaleDown:260
>>> » ThreadTimeout
>>>
>>> When running integration test only, there is no test failure and I'm
>>> getting NPE in GroupMonitor class.
>>>
>>>>
>>>> I noticed the same behavior as you have explained. When I check the log
>>>> file
>>>> in /test-integration/target/<carbon-home>/repository/logs/wso2carbon.log, I
>>>> didn't see any NPE's related to Drool files. Only one NPE is thrown from
>>>> GroupMonitor class. Can you check whether it is the same for you?
>>>>
>>>
>>> Yes, if I ran integration test directly, NPE was thrown in GroupMonitor
>>> class and no drools error were there.
>>>
>>>>
>>>> Thanks.
>>>>
>>>> On Wed, Oct 7, 2015 at 1:05 AM, Akila Ravihansa Perera <
>>>> ravihansa@wso2.com> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> It seems integration tests are failing intermittently regardless of
>>>>> NPE's thrown from Drool files. I've added more debug logs to troubleshoot
>>>>> the issue. I've set the default log level in AS and CC packages to DEBUG in
>>>>> integration tests. This will help us to identify the root causes of
>>>>> integration test failures in Jenkins build.
>>>>>
>>>>> Thanks.
>>>>>
>>>>>
>>>>> On Tue, Oct 6, 2015 at 12:38 PM, Thanuja Uruththirakodeeswaran <
>>>>> thanujau@wso2.com> wrote:
>>>>>
>>>>>> Hi Akila,
>>>>>>
>>>>>> I'll check this and let you know.
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> On Tue, Oct 6, 2015 at 12:31 PM, Akila Ravihansa Perera <
>>>>>> ravihansa@wso2.com> wrote:
>>>>>>
>>>>>>> Hi Thanuja,
>>>>>>>
>>>>>>> I noticed that integration tests are failing in stratos-4.1.x branch
>>>>>>> due to an issue in Drools files. It seems there have been couple of
>>>>>>> modifications done for Drools files with new metering dashboard feature.
>>>>>>> Perhaps it is incompatible with autoscaler APIs. Could you look into that
>>>>>>> please?
>>>>>>>
>>>>>>> Thanks.
>>>>>>>
>>>>>>> --
>>>>>>> Akila Ravihansa Perera
>>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>>
>>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> Thanuja Uruththirakodeeswaran
>>>>>> Software Engineer
>>>>>> WSO2 Inc.;http://wso2.com
>>>>>> lean.enterprise.middleware
>>>>>>
>>>>>> mobile: +94 774363167
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Akila Ravihansa Perera
>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>
>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Akila Ravihansa Perera
>>>> WSO2 Inc.;  http://wso2.com/
>>>>
>>>> Blog: http://ravihansa3000.blogspot.com
>>>>
>>>
>>>
>>>
>>> --
>>> Thanuja Uruththirakodeeswaran
>>> Software Engineer
>>> WSO2 Inc.;http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: +94 774363167
>>>
>>
>>
>>
>> --
>> Imesh Gunaratne
>>
>> Senior Technical Lead, WSO2
>> Committer & PMC Member, Apache Stratos
>>
>
>
>
> --
> Reka Thirunavukkarasu
> Senior Software Engineer,
> WSO2, Inc.:http://wso2.com,
> Mobile: +94776442007
>
>
>


-- 
Reka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +94776442007

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Reka Thirunavukkarasu <re...@wso2.com>.
Hi Imesh,

On Wed, Oct 7, 2015 at 5:46 AM, Imesh Gunaratne <im...@apache.org> wrote:

> GroupMonitor:
>
>       ApplicationMonitor applicationMonitor =
> AutoscalerContext.getInstance().
>                             getAppMonitor(appId);
>
> [161] //When the application is getting un-deployed, need to avoid
> [162] // checking the minimum count sanctification
> [163] if (!applicationMonitor.isTerminating()) {
>
> In GroupMonitor class the line number 163 is shown above, may be due to
> some reason application monitor is not found when executing the group
> monitor.
>
> @Reka: Do you have any thoughts on this?
>

Yah..It could happen when force undeployment is invoked. I will check on
this..

Thanks,
Reka

>
> Thanks
>
> On Wed, Oct 7, 2015 at 1:20 AM, Thanuja Uruththirakodeeswaran <
> thanujau@wso2.com> wrote:
>
>> Hi Akila,
>>
>>
>> On Wed, Oct 7, 2015 at 1:09 AM, Akila Ravihansa Perera <
>> ravihansa@wso2.com> wrote:
>>
>>> Hi Thanuja,
>>>
>>> Thanks for the update.
>>>
>>> In both of those cases, did you observe any build failures? If so, what
>>> are the tests that failed?
>>>
>>
>> For the complete stratos build, following test cases are failing with NPE
>> in ClusterMonitor as shown above:
>> Failed tests:
>>   ApplicationBurstingTestCase.testApplicationBusting:138
>>   GroupStartupOrderTestCase.testTerminationBehavior:194 Application
>> status did not change to Active: [application-id] group-startup-order-test
>> expected:<Active> but was:<Inactive>
>>   SampleApplicationStartupTestCase.testApplication:103
>>   SampleApplicationsTestCase.testApplication:57 » Runtime
>>   SampleApplicationsTestCase.testApplicationList:252 » Runtime
>>
>> SingleClusterScalingTestCase.testDeployApplication:117->assertClusterWithScaleDown:260
>> » ThreadTimeout
>>
>> When running integration test only, there is no test failure and I'm
>> getting NPE in GroupMonitor class.
>>
>>>
>>> I noticed the same behavior as you have explained. When I check the log
>>> file
>>> in /test-integration/target/<carbon-home>/repository/logs/wso2carbon.log, I
>>> didn't see any NPE's related to Drool files. Only one NPE is thrown from
>>> GroupMonitor class. Can you check whether it is the same for you?
>>>
>>
>> Yes, if I ran integration test directly, NPE was thrown in GroupMonitor
>> class and no drools error were there.
>>
>>>
>>> Thanks.
>>>
>>> On Wed, Oct 7, 2015 at 1:05 AM, Akila Ravihansa Perera <
>>> ravihansa@wso2.com> wrote:
>>>
>>>> Hi,
>>>>
>>>> It seems integration tests are failing intermittently regardless of
>>>> NPE's thrown from Drool files. I've added more debug logs to troubleshoot
>>>> the issue. I've set the default log level in AS and CC packages to DEBUG in
>>>> integration tests. This will help us to identify the root causes of
>>>> integration test failures in Jenkins build.
>>>>
>>>> Thanks.
>>>>
>>>>
>>>> On Tue, Oct 6, 2015 at 12:38 PM, Thanuja Uruththirakodeeswaran <
>>>> thanujau@wso2.com> wrote:
>>>>
>>>>> Hi Akila,
>>>>>
>>>>> I'll check this and let you know.
>>>>>
>>>>> Thanks.
>>>>>
>>>>> On Tue, Oct 6, 2015 at 12:31 PM, Akila Ravihansa Perera <
>>>>> ravihansa@wso2.com> wrote:
>>>>>
>>>>>> Hi Thanuja,
>>>>>>
>>>>>> I noticed that integration tests are failing in stratos-4.1.x branch
>>>>>> due to an issue in Drools files. It seems there have been couple of
>>>>>> modifications done for Drools files with new metering dashboard feature.
>>>>>> Perhaps it is incompatible with autoscaler APIs. Could you look into that
>>>>>> please?
>>>>>>
>>>>>> Thanks.
>>>>>>
>>>>>> --
>>>>>> Akila Ravihansa Perera
>>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>>
>>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>>
>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> Thanuja Uruththirakodeeswaran
>>>>> Software Engineer
>>>>> WSO2 Inc.;http://wso2.com
>>>>> lean.enterprise.middleware
>>>>>
>>>>> mobile: +94 774363167
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Akila Ravihansa Perera
>>>> WSO2 Inc.;  http://wso2.com/
>>>>
>>>> Blog: http://ravihansa3000.blogspot.com
>>>>
>>>
>>>
>>>
>>> --
>>> Akila Ravihansa Perera
>>> WSO2 Inc.;  http://wso2.com/
>>>
>>> Blog: http://ravihansa3000.blogspot.com
>>>
>>
>>
>>
>> --
>> Thanuja Uruththirakodeeswaran
>> Software Engineer
>> WSO2 Inc.;http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 774363167
>>
>
>
>
> --
> Imesh Gunaratne
>
> Senior Technical Lead, WSO2
> Committer & PMC Member, Apache Stratos
>



-- 
Reka Thirunavukkarasu
Senior Software Engineer,
WSO2, Inc.:http://wso2.com,
Mobile: +94776442007

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Imesh Gunaratne <im...@apache.org>.
GroupMonitor:

      ApplicationMonitor applicationMonitor =
AutoscalerContext.getInstance().
                            getAppMonitor(appId);

[161] //When the application is getting un-deployed, need to avoid
[162] // checking the minimum count sanctification
[163] if (!applicationMonitor.isTerminating()) {

In GroupMonitor class the line number 163 is shown above, may be due to
some reason application monitor is not found when executing the group
monitor.

@Reka: Do you have any thoughts on this?

Thanks

On Wed, Oct 7, 2015 at 1:20 AM, Thanuja Uruththirakodeeswaran <
thanujau@wso2.com> wrote:

> Hi Akila,
>
>
> On Wed, Oct 7, 2015 at 1:09 AM, Akila Ravihansa Perera <ravihansa@wso2.com
> > wrote:
>
>> Hi Thanuja,
>>
>> Thanks for the update.
>>
>> In both of those cases, did you observe any build failures? If so, what
>> are the tests that failed?
>>
>
> For the complete stratos build, following test cases are failing with NPE
> in ClusterMonitor as shown above:
> Failed tests:
>   ApplicationBurstingTestCase.testApplicationBusting:138
>   GroupStartupOrderTestCase.testTerminationBehavior:194 Application status
> did not change to Active: [application-id] group-startup-order-test
> expected:<Active> but was:<Inactive>
>   SampleApplicationStartupTestCase.testApplication:103
>   SampleApplicationsTestCase.testApplication:57 » Runtime
>   SampleApplicationsTestCase.testApplicationList:252 » Runtime
>
> SingleClusterScalingTestCase.testDeployApplication:117->assertClusterWithScaleDown:260
> » ThreadTimeout
>
> When running integration test only, there is no test failure and I'm
> getting NPE in GroupMonitor class.
>
>>
>> I noticed the same behavior as you have explained. When I check the log
>> file
>> in /test-integration/target/<carbon-home>/repository/logs/wso2carbon.log, I
>> didn't see any NPE's related to Drool files. Only one NPE is thrown from
>> GroupMonitor class. Can you check whether it is the same for you?
>>
>
> Yes, if I ran integration test directly, NPE was thrown in GroupMonitor
> class and no drools error were there.
>
>>
>> Thanks.
>>
>> On Wed, Oct 7, 2015 at 1:05 AM, Akila Ravihansa Perera <
>> ravihansa@wso2.com> wrote:
>>
>>> Hi,
>>>
>>> It seems integration tests are failing intermittently regardless of
>>> NPE's thrown from Drool files. I've added more debug logs to troubleshoot
>>> the issue. I've set the default log level in AS and CC packages to DEBUG in
>>> integration tests. This will help us to identify the root causes of
>>> integration test failures in Jenkins build.
>>>
>>> Thanks.
>>>
>>>
>>> On Tue, Oct 6, 2015 at 12:38 PM, Thanuja Uruththirakodeeswaran <
>>> thanujau@wso2.com> wrote:
>>>
>>>> Hi Akila,
>>>>
>>>> I'll check this and let you know.
>>>>
>>>> Thanks.
>>>>
>>>> On Tue, Oct 6, 2015 at 12:31 PM, Akila Ravihansa Perera <
>>>> ravihansa@wso2.com> wrote:
>>>>
>>>>> Hi Thanuja,
>>>>>
>>>>> I noticed that integration tests are failing in stratos-4.1.x branch
>>>>> due to an issue in Drools files. It seems there have been couple of
>>>>> modifications done for Drools files with new metering dashboard feature.
>>>>> Perhaps it is incompatible with autoscaler APIs. Could you look into that
>>>>> please?
>>>>>
>>>>> Thanks.
>>>>>
>>>>> --
>>>>> Akila Ravihansa Perera
>>>>> WSO2 Inc.;  http://wso2.com/
>>>>>
>>>>> Blog: http://ravihansa3000.blogspot.com
>>>>>
>>>>
>>>>
>>>>
>>>> --
>>>> Thanuja Uruththirakodeeswaran
>>>> Software Engineer
>>>> WSO2 Inc.;http://wso2.com
>>>> lean.enterprise.middleware
>>>>
>>>> mobile: +94 774363167
>>>>
>>>
>>>
>>>
>>> --
>>> Akila Ravihansa Perera
>>> WSO2 Inc.;  http://wso2.com/
>>>
>>> Blog: http://ravihansa3000.blogspot.com
>>>
>>
>>
>>
>> --
>> Akila Ravihansa Perera
>> WSO2 Inc.;  http://wso2.com/
>>
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
> Thanuja Uruththirakodeeswaran
> Software Engineer
> WSO2 Inc.;http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 774363167
>



-- 
Imesh Gunaratne

Senior Technical Lead, WSO2
Committer & PMC Member, Apache Stratos

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Thanuja Uruththirakodeeswaran <th...@wso2.com>.
Hi Akila,


On Wed, Oct 7, 2015 at 1:09 AM, Akila Ravihansa Perera <ra...@wso2.com>
wrote:

> Hi Thanuja,
>
> Thanks for the update.
>
> In both of those cases, did you observe any build failures? If so, what
> are the tests that failed?
>

For the complete stratos build, following test cases are failing with NPE
in ClusterMonitor as shown above:
Failed tests:
  ApplicationBurstingTestCase.testApplicationBusting:138
  GroupStartupOrderTestCase.testTerminationBehavior:194 Application status
did not change to Active: [application-id] group-startup-order-test
expected:<Active> but was:<Inactive>
  SampleApplicationStartupTestCase.testApplication:103
  SampleApplicationsTestCase.testApplication:57 » Runtime
  SampleApplicationsTestCase.testApplicationList:252 » Runtime

SingleClusterScalingTestCase.testDeployApplication:117->assertClusterWithScaleDown:260
» ThreadTimeout

When running integration test only, there is no test failure and I'm
getting NPE in GroupMonitor class.

>
> I noticed the same behavior as you have explained. When I check the log
> file
> in /test-integration/target/<carbon-home>/repository/logs/wso2carbon.log, I
> didn't see any NPE's related to Drool files. Only one NPE is thrown from
> GroupMonitor class. Can you check whether it is the same for you?
>

Yes, if I ran integration test directly, NPE was thrown in GroupMonitor
class and no drools error were there.

>
> Thanks.
>
> On Wed, Oct 7, 2015 at 1:05 AM, Akila Ravihansa Perera <ravihansa@wso2.com
> > wrote:
>
>> Hi,
>>
>> It seems integration tests are failing intermittently regardless of NPE's
>> thrown from Drool files. I've added more debug logs to troubleshoot the
>> issue. I've set the default log level in AS and CC packages to DEBUG in
>> integration tests. This will help us to identify the root causes of
>> integration test failures in Jenkins build.
>>
>> Thanks.
>>
>>
>> On Tue, Oct 6, 2015 at 12:38 PM, Thanuja Uruththirakodeeswaran <
>> thanujau@wso2.com> wrote:
>>
>>> Hi Akila,
>>>
>>> I'll check this and let you know.
>>>
>>> Thanks.
>>>
>>> On Tue, Oct 6, 2015 at 12:31 PM, Akila Ravihansa Perera <
>>> ravihansa@wso2.com> wrote:
>>>
>>>> Hi Thanuja,
>>>>
>>>> I noticed that integration tests are failing in stratos-4.1.x branch
>>>> due to an issue in Drools files. It seems there have been couple of
>>>> modifications done for Drools files with new metering dashboard feature.
>>>> Perhaps it is incompatible with autoscaler APIs. Could you look into that
>>>> please?
>>>>
>>>> Thanks.
>>>>
>>>> --
>>>> Akila Ravihansa Perera
>>>> WSO2 Inc.;  http://wso2.com/
>>>>
>>>> Blog: http://ravihansa3000.blogspot.com
>>>>
>>>
>>>
>>>
>>> --
>>> Thanuja Uruththirakodeeswaran
>>> Software Engineer
>>> WSO2 Inc.;http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: +94 774363167
>>>
>>
>>
>>
>> --
>> Akila Ravihansa Perera
>> WSO2 Inc.;  http://wso2.com/
>>
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
> Akila Ravihansa Perera
> WSO2 Inc.;  http://wso2.com/
>
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Thanuja Uruththirakodeeswaran
Software Engineer
WSO2 Inc.;http://wso2.com
lean.enterprise.middleware

mobile: +94 774363167

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
Hi Thanuja,

Thanks for the update.

In both of those cases, did you observe any build failures? If so, what are
the tests that failed?

I noticed the same behavior as you have explained. When I check the log
file
in /test-integration/target/<carbon-home>/repository/logs/wso2carbon.log, I
didn't see any NPE's related to Drool files. Only one NPE is thrown from
GroupMonitor class. Can you check whether it is the same for you?

Thanks.

On Wed, Oct 7, 2015 at 1:05 AM, Akila Ravihansa Perera <ra...@wso2.com>
wrote:

> Hi,
>
> It seems integration tests are failing intermittently regardless of NPE's
> thrown from Drool files. I've added more debug logs to troubleshoot the
> issue. I've set the default log level in AS and CC packages to DEBUG in
> integration tests. This will help us to identify the root causes of
> integration test failures in Jenkins build.
>
> Thanks.
>
>
> On Tue, Oct 6, 2015 at 12:38 PM, Thanuja Uruththirakodeeswaran <
> thanujau@wso2.com> wrote:
>
>> Hi Akila,
>>
>> I'll check this and let you know.
>>
>> Thanks.
>>
>> On Tue, Oct 6, 2015 at 12:31 PM, Akila Ravihansa Perera <
>> ravihansa@wso2.com> wrote:
>>
>>> Hi Thanuja,
>>>
>>> I noticed that integration tests are failing in stratos-4.1.x branch due
>>> to an issue in Drools files. It seems there have been couple of
>>> modifications done for Drools files with new metering dashboard feature.
>>> Perhaps it is incompatible with autoscaler APIs. Could you look into that
>>> please?
>>>
>>> Thanks.
>>>
>>> --
>>> Akila Ravihansa Perera
>>> WSO2 Inc.;  http://wso2.com/
>>>
>>> Blog: http://ravihansa3000.blogspot.com
>>>
>>
>>
>>
>> --
>> Thanuja Uruththirakodeeswaran
>> Software Engineer
>> WSO2 Inc.;http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 774363167
>>
>
>
>
> --
> Akila Ravihansa Perera
> WSO2 Inc.;  http://wso2.com/
>
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Akila Ravihansa Perera
WSO2 Inc.;  http://wso2.com/

Blog: http://ravihansa3000.blogspot.com

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Akila Ravihansa Perera <ra...@wso2.com>.
Hi,

It seems integration tests are failing intermittently regardless of NPE's
thrown from Drool files. I've added more debug logs to troubleshoot the
issue. I've set the default log level in AS and CC packages to DEBUG in
integration tests. This will help us to identify the root causes of
integration test failures in Jenkins build.

Thanks.


On Tue, Oct 6, 2015 at 12:38 PM, Thanuja Uruththirakodeeswaran <
thanujau@wso2.com> wrote:

> Hi Akila,
>
> I'll check this and let you know.
>
> Thanks.
>
> On Tue, Oct 6, 2015 at 12:31 PM, Akila Ravihansa Perera <
> ravihansa@wso2.com> wrote:
>
>> Hi Thanuja,
>>
>> I noticed that integration tests are failing in stratos-4.1.x branch due
>> to an issue in Drools files. It seems there have been couple of
>> modifications done for Drools files with new metering dashboard feature.
>> Perhaps it is incompatible with autoscaler APIs. Could you look into that
>> please?
>>
>> Thanks.
>>
>> --
>> Akila Ravihansa Perera
>> WSO2 Inc.;  http://wso2.com/
>>
>> Blog: http://ravihansa3000.blogspot.com
>>
>
>
>
> --
> Thanuja Uruththirakodeeswaran
> Software Engineer
> WSO2 Inc.;http://wso2.com
> lean.enterprise.middleware
>
> mobile: +94 774363167
>



-- 
Akila Ravihansa Perera
WSO2 Inc.;  http://wso2.com/

Blog: http://ravihansa3000.blogspot.com

Re: NPE while executing Drool methods - Integration tests are failing

Posted by Thanuja Uruththirakodeeswaran <th...@wso2.com>.
Hi Akila,

I'll check this and let you know.

Thanks.

On Tue, Oct 6, 2015 at 12:31 PM, Akila Ravihansa Perera <ra...@wso2.com>
wrote:

> Hi Thanuja,
>
> I noticed that integration tests are failing in stratos-4.1.x branch due
> to an issue in Drools files. It seems there have been couple of
> modifications done for Drools files with new metering dashboard feature.
> Perhaps it is incompatible with autoscaler APIs. Could you look into that
> please?
>
> Thanks.
>
> --
> Akila Ravihansa Perera
> WSO2 Inc.;  http://wso2.com/
>
> Blog: http://ravihansa3000.blogspot.com
>



-- 
Thanuja Uruththirakodeeswaran
Software Engineer
WSO2 Inc.;http://wso2.com
lean.enterprise.middleware

mobile: +94 774363167