Fixed the issue and create a new PR [2].

The problem was, canAccess method in CallerContext has been incrementing
both global and local counts. Due to this, a single request gets counted
twice, and throttling quota gets depleted before reaching the maximum
number of allowed requests.

After fixing the issue, re-ran the integration tests and this
time Throttling related failures couldn't be seen but there were three test
failures. After doing a second run, got two of them passing, but still
there's one failure (which is pasted below) that occurs even on a vanilla
pack. (Results for the two runs can be found at [3] & [4]) .

Test class:
org.wso2.carbon.esb.endpoint.test.ESBJAVA3047Soap12EndpointTestCase
Test method: Sending a Message to a Soap12 endpoint and checks weather
'action' is present in Content-Type header
java.lang.AssertionError: Unable to find the action in Content-type head
for SOAP 1.2 message: header returned [ null] expected:<true> but
was:<false>
at org.testng.Assert.fail(Assert.java:89)
at org.testng.Assert.failNotEquals(Assert.java:489)
at org.testng.Assert.assertTrue(Assert.java:37)
at
org.wso2.carbon.esb.endpoint.test.ESBJAVA3047Soap12EndpointTestCase.testSoap12EndpointForAction(ESBJAVA3047Soap12EndpointTestCase.java:88)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.testng.internal.MethodInvocationHelper.invokeMethod(MethodInvocationHelper.java:80)
at org.testng.internal.Invoker.invokeMethod(Invoker.java:673)
at org.testng.internal.Invoker.invokeTestMethod(Invoker.java:842)
at org.testng.internal.Invoker.invokeTestMethods(Invoker.java:1166)
at
org.testng.internal.TestMethodWorker.invokeTestMethods(TestMethodWorker.java:125)
at org.testng.internal.TestMethodWorker.run(TestMethodWorker.java:109)
at org.testng.TestRunner.runWorkers(TestRunner.java:1178)
at org.testng.TestRunner.privateRun(TestRunner.java:757)
at org.testng.TestRunner.run(TestRunner.java:608)
at org.testng.SuiteRunner.runTest(SuiteRunner.java:334)
at org.testng.SuiteRunner.runSequentially(SuiteRunner.java:329)
at org.testng.SuiteRunner.privateRun(SuiteRunner.java:291)
at org.testng.SuiteRunner.run(SuiteRunner.java:240)
at org.testng.SuiteRunnerWorker.runSuite(SuiteRunnerWorker.java:52)
at org.testng.SuiteRunnerWorker.run(SuiteRunnerWorker.java:86)
at org.testng.TestNG.runSuitesSequentially(TestNG.java:1158)
at org.testng.TestNG.runSuitesLocally(TestNG.java:1083)
at org.testng.TestNG.run(TestNG.java:999)
at
org.apache.maven.surefire.testng.TestNGExecutor.run(TestNGExecutor.java:178)
at
org.apache.maven.surefire.testng.TestNGXmlTestSuite.execute(TestNGXmlTestSuite.java:92)
at
org.apache.maven.surefire.testng.TestNGProvider.invoke(TestNGProvider.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at
org.apache.maven.surefire.util.ReflectionUtils.invokeMethodWithArray(ReflectionUtils.java:189)
at
org.apache.maven.surefire.booter.ProviderFactory$ProviderProxy.invoke(ProviderFactory.java:165)
at
org.apache.maven.surefire.booter.ProviderFactory.invokeProvider(ProviderFactory.java:85)
at
org.apache.maven.surefire.booter.ForkedBooter.runSuitesInProcess(ForkedBooter.java:115)
at org.apache.maven.surefire.booter.ForkedBooter.main(ForkedBooter.java:75)

Is it safe to ignore this failure?

[2] https://github.com/wso2/wso2-synapse/pull/369
[3]
https://drive.google.com/a/wso2.com/file/d/0BxlcfaVDH9iFNkMwSHlpbGwxSlE/view?usp=sharing
[4]
https://drive.google.com/a/wso2.com/file/d/0BxlcfaVDH9iFa2RtQUJaUTB5RlU/view?usp=sharing
On Saturday, September 26, 2015, Amila De Silva <[email protected]> wrote:

> Hi Chanaka,
> Will check this.
>
>
> On Saturday, September 26, 2015, Chanaka Fernando <[email protected]>
> wrote:
>
>> Hi AmilaD,
>>
>> After merging this change, we have seen that there are 3 integration test
>> failures in product-esb[1] . Please check these failures and resend the PR.
>> I'll revert the fix for the moment.
>>
>> [1] https://wso2.org/jenkins/job/product-esb/lastBuild/testReport/
>>
>> On Fri, Sep 25, 2015 at 3:13 PM, Chanaka Fernando <[email protected]>
>> wrote:
>>
>>> Hi Amila,
>>>
>>> PR[1] is merged.
>>>
>>> [1]
>>> https://github.com/wso2/wso2-synapse/commit/d5815b2afcf7f2d9c8e5e5858e8cc45427a07ce0
>>>
>>> On Fri, Sep 25, 2015 at 2:43 PM, Amila De Silva <[email protected]> wrote:
>>>
>>>> Hi,
>>>>
>>>> Tested RoleBased Throttling on a two node APIM cluster after applying
>>>> new changes. Counts are properly getting replicated across all the nodes.
>>>>
>>>> On Tue, Sep 15, 2015 at 5:05 PM, Amila De Silva <[email protected]>
>>>> wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> Created the PR[1], by merging latest throttling fixes with
>>>>> synapse-commons. After doing the changes, was able to successfully build
>>>>> wso2-synapse and carbon-mediation with unit tests. Ran all the integration
>>>>> tests in product-esb, after building the product on top of latest synapse
>>>>> and carbon-mediation changes.
>>>>>
>>>>> Please review and merge the PR.
>>>>>
>>>>> [1] https://github.com/wso2/wso2-synapse/pull/360
>>>>>
>>>>> On Mon, Sep 14, 2015 at 5:07 PM, Amila De Silva <[email protected]>
>>>>> wrote:
>>>>>
>>>>>> Hi Isuru,
>>>>>>
>>>>>> There aren't any changes to be merged on MEPClient and
>>>>>> SynapseCallbackReceiver. Changes that need merging are done on classes
>>>>>> residing under [1].
>>>>>>
>>>>>> Let me clarify a bit what these changes are;
>>>>>>
>>>>>> While fixing some throttling issues in AM 1.6.0, certain changes were
>>>>>> done on the part that replicates throttling counters. Earlier these
>>>>>> counters were replicated using a ClusterMessage, but after the fixes
>>>>>> counters are replicated using  Hazelcast AtomicLongs. The fixes were
>>>>>> done on org.wso2.carbon.throttle.core_4.2.0, which is maintained in
>>>>>> svn and after fixes were done, throttle.core needs depending on
>>>>>> com.hazelcast.wso2 component.
>>>>>>
>>>>>> When moving synapse code on to Git, throttle.core has been absorbed
>>>>>> into synapse, and now it is kept under [1]. Parallel to the changes
>>>>>> mentioned above, some other fixes have been done on the throttling &
>>>>>> synapse (which now is on Git) and it's those changes that make synapse
>>>>>> depend on throttle core. The change is MEPClient and
>>>>>> SynapseCallbackReceiver using a reference of ConcurrentAccessController
>>>>>> (you can find the specific code changes at [2])
>>>>>>
>>>>>>
>>>>>> [1]
>>>>>> https://github.com/wso2/wso2-synapse/tree/master/modules/commons/src/main/java/org/apache/synapse/commons/throttle
>>>>>> [2]
>>>>>> https://github.com/wso2/wso2-synapse/blob/master/modules/core/src/main/java/org/apache/synapse/core/axis2/SynapseCallbackReceiver.java#L497-L515
>>>>>>
>>>>>>
>>>>>>
>>>>>> On Mon, Sep 14, 2015 at 3:54 PM, Isuru Udana <[email protected]> wrote:
>>>>>>
>>>>>>> Hi AmilaD,
>>>>>>>
>>>>>>> Can you please point us the changes need to be merged in synapse (in
>>>>>>> MEPClient and SynapseCallbackReceiver) ?
>>>>>>>
>>>>>>> On Mon, Sep 14, 2015 at 2:58 PM, Amila De Silva <[email protected]>
>>>>>>> wrote:
>>>>>>>
>>>>>>>> Hi All,
>>>>>>>>
>>>>>>>> While carrying out this task, came to a point where certain classes
>>>>>>>> cannot be moved out of synapse.
>>>>>>>>
>>>>>>>> For some of the improvements done recently,
>>>>>>>> ConcurrentAccessController (which is one of the classes that originally
>>>>>>>> resided in throttle core) has been used from SynapseCallbackReceiver
>>>>>>>> and Axis2FlexibleMEPClient. So now either ConcurrentAccessController 
>>>>>>>> has to
>>>>>>>> reside inside synapse, or else it has to go into another
>>>>>>>> different component on which synapse would have to depend on. The whole
>>>>>>>> point of moving throttling related code out of synapse is to prevent
>>>>>>>> synapse depending on any carbon components.
>>>>>>>>
>>>>>>>> Since synapse depending on Hazelcast is not something that can be
>>>>>>>> eliminated completely, is it fine to keep throttle.core inside synapse 
>>>>>>>> and
>>>>>>>> merge new changes? When merging throttling fixes, either we have to
>>>>>>>> introduce a service component to synapse, which would
>>>>>>>> consume hazelcast.instance.service or we have to provide a method to 
>>>>>>>> set
>>>>>>>> the HazelcastInstance that will be used for replicating throttling 
>>>>>>>> counts.
>>>>>>>>
>>>>>>>> On Fri, Sep 11, 2015 at 9:01 PM, Amila De Silva <[email protected]>
>>>>>>>> wrote:
>>>>>>>>
>>>>>>>>> Hi Chanaka,
>>>>>>>>>
>>>>>>>>> Since throttle core can be used on its own, thought of creating a
>>>>>>>>> separate feature out of that - so a new place to put throttle 
>>>>>>>>> component. If
>>>>>>>>> we put it under mediation-throttle, that would imply two components 
>>>>>>>>> have to
>>>>>>>>> be used together, isn't it?
>>>>>>>>>
>>>>>>>>> On Fri, Sep 11, 2015 at 6:45 PM, Chanaka Fernando <
>>>>>>>>> [email protected]> wrote:
>>>>>>>>>
>>>>>>>>>> Hi Amila,
>>>>>>>>>>
>>>>>>>>>> You can find [1] which already has the throttle policy editor
>>>>>>>>>> related packages and named as mediation-throttle. You can move the
>>>>>>>>>> throttle-core packages to this component.
>>>>>>>>>>
>>>>>>>>>> [1]
>>>>>>>>>> https://github.com/wso2/carbon-mediation/tree/master/components/mediation-throttle
>>>>>>>>>>
>>>>>>>>>> On Fri, Sep 11, 2015 at 6:23 PM, Sanjeewa Malalgoda <
>>>>>>>>>> [email protected]> wrote:
>>>>>>>>>>
>>>>>>>>>>> +1.
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> On Fri, Sep 11, 2015 at 5:20 PM, Amila De Silva <[email protected]
>>>>>>>>>>> > wrote:
>>>>>>>>>>>
>>>>>>>>>>>> Will be moving throttle.core to a new component under
>>>>>>>>>>>> carbon-mediation. The new component name will be throttle-core and 
>>>>>>>>>>>> a new
>>>>>>>>>>>> feature with the same name will be created. Planning to do these 
>>>>>>>>>>>> changes on
>>>>>>>>>>>> carbon-mediation 4.4.11-SNAPSHOT and synapse 
>>>>>>>>>>>> 2.1.3-wso2v12-SNAPSHOT.
>>>>>>>>>>>>
>>>>>>>>>>>> On Mon, Sep 7, 2015 at 6:25 PM, Amila De Silva <[email protected]
>>>>>>>>>>>> > wrote:
>>>>>>>>>>>>
>>>>>>>>>>>>> Hi All,
>>>>>>>>>>>>>
>>>>>>>>>>>>> One of the changes done while moving to Git was, moving source
>>>>>>>>>>>>> code which was under org.wso2.carbon.throttle.core to 
>>>>>>>>>>>>> wso2-synapse.
>>>>>>>>>>>>> Throttle core is used by both ESB (in Throttle mediator) and by 
>>>>>>>>>>>>> API Manager
>>>>>>>>>>>>> (in APIThrottleHandler - to keep track of the number of API calls 
>>>>>>>>>>>>> made over
>>>>>>>>>>>>> the cluster). At the time throttle core was moved, it was 
>>>>>>>>>>>>> depending on
>>>>>>>>>>>>> Axis2 only, making it possible to move the source code to 
>>>>>>>>>>>>> wso2-synapse -
>>>>>>>>>>>>> which is not depending on any carbon components.
>>>>>>>>>>>>>
>>>>>>>>>>>>> While doing several improvements on throttling, Hazelcast
>>>>>>>>>>>>> AtomicLongs were used for keeping cluster-wide counts, which now 
>>>>>>>>>>>>> creates a
>>>>>>>>>>>>> coupling between Hazelcast and Throttle Core. If these changes 
>>>>>>>>>>>>> are to be
>>>>>>>>>>>>> merged with synapse, we would have to add a dependency to 
>>>>>>>>>>>>> Hazelcast.
>>>>>>>>>>>>>
>>>>>>>>>>>>> The other option is to move Throttle Core into
>>>>>>>>>>>>> carbon-mediation. Since this already depends on several carbon 
>>>>>>>>>>>>> components
>>>>>>>>>>>>> adding Hazelcast as a dependancy won't be an issue.
>>>>>>>>>>>>>
>>>>>>>>>>>>> --
>>>>>>>>>>>>> *Amila De Silva*
>>>>>>>>>>>>>
>>>>>>>>>>>>> WSO2 Inc.
>>>>>>>>>>>>> mobile :(+94) 775119302
>>>>>>>>>>>>>
>>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>> --
>>>>>>>>>>>> *Amila De Silva*
>>>>>>>>>>>>
>>>>>>>>>>>> WSO2 Inc.
>>>>>>>>>>>> mobile :(+94) 775119302
>>>>>>>>>>>>
>>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>> --
>>>>>>>>>>>
>>>>>>>>>>> *Sanjeewa Malalgoda*
>>>>>>>>>>> WSO2 Inc.
>>>>>>>>>>> Mobile : +94713068779
>>>>>>>>>>>
>>>>>>>>>>> <http://sanjeewamalalgoda.blogspot.com/>blog
>>>>>>>>>>> :http://sanjeewamalalgoda.blogspot.com/
>>>>>>>>>>> <http://sanjeewamalalgoda.blogspot.com/>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>> --
>>>>>>>>>> --
>>>>>>>>>> Chanaka Fernando
>>>>>>>>>> Senior Technical Lead
>>>>>>>>>> WSO2, Inc.; http://wso2.com
>>>>>>>>>> lean.enterprise.middleware
>>>>>>>>>>
>>>>>>>>>> mobile: +94 773337238
>>>>>>>>>> Blog : http://soatutorials.blogspot.com
>>>>>>>>>> LinkedIn:http://www.linkedin.com/pub/chanaka-fernando/19/a20/5b0
>>>>>>>>>> Twitter:https://twitter.com/chanakaudaya
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>> --
>>>>>>>>> *Amila De Silva*
>>>>>>>>>
>>>>>>>>> WSO2 Inc.
>>>>>>>>> mobile :(+94) 775119302
>>>>>>>>>
>>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>> --
>>>>>>>> *Amila De Silva*
>>>>>>>>
>>>>>>>> WSO2 Inc.
>>>>>>>> mobile :(+94) 775119302
>>>>>>>>
>>>>>>>>
>>>>>>>> _______________________________________________
>>>>>>>> Dev mailing list
>>>>>>>> [email protected]
>>>>>>>> http://wso2.org/cgi-bin/mailman/listinfo/dev
>>>>>>>>
>>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> --
>>>>>>> *Isuru Udana*
>>>>>>> Associate Technical Lead
>>>>>>> WSO2 Inc.; http://wso2.com
>>>>>>> email: [email protected] cell: +94 77 3791887
>>>>>>> blog: http://mytecheye.blogspot.com/
>>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>> --
>>>>>> *Amila De Silva*
>>>>>>
>>>>>> WSO2 Inc.
>>>>>> mobile :(+94) 775119302
>>>>>>
>>>>>>
>>>>>
>>>>>
>>>>> --
>>>>> *Amila De Silva*
>>>>>
>>>>> WSO2 Inc.
>>>>> mobile :(+94) 775119302
>>>>>
>>>>>
>>>>
>>>>
>>>> --
>>>> *Amila De Silva*
>>>>
>>>> WSO2 Inc.
>>>> mobile :(+94) 775119302
>>>>
>>>>
>>>
>>>
>>> --
>>> --
>>> Chanaka Fernando
>>> Senior Technical Lead
>>> WSO2, Inc.; http://wso2.com
>>> lean.enterprise.middleware
>>>
>>> mobile: +94 773337238
>>> Blog : http://soatutorials.blogspot.com
>>> LinkedIn:http://www.linkedin.com/pub/chanaka-fernando/19/a20/5b0
>>> Twitter:https://twitter.com/chanakaudaya
>>>
>>>
>>>
>>>
>>>
>>
>>
>> --
>> --
>> Chanaka Fernando
>> Senior Technical Lead
>> WSO2, Inc.; http://wso2.com
>> lean.enterprise.middleware
>>
>> mobile: +94 773337238
>> Blog : http://soatutorials.blogspot.com
>> LinkedIn:http://www.linkedin.com/pub/chanaka-fernando/19/a20/5b0
>> Twitter:https://twitter.com/chanakaudaya
>>
>>
>>
>>
>>
>
> --
> *Amila De Silva*
>
> WSO2 Inc.
> mobile :(+94) 775119302
>
>
>
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to