Hi Sameera,

Please apply the attached patch to
https://svn.wso2.org/repos/wso2/carbon/platform/trunk/components/load-balancer/lb-endpoint/org.wso2.carbon.lb.endpoint


On Fri, Aug 16, 2013 at 9:39 PM, Lahiru Sandaruwan <lahi...@wso2.com> wrote:

> Hi,
>
>
> On Fri, Aug 16, 2013 at 8:31 PM, Nirmal Fernando <nir...@wso2.com> wrote:
>
>> Hi,
>>
>>
>> On Fri, Aug 16, 2013 at 7:43 PM, Sameera Jayasoma <same...@wso2.com>wrote:
>>
>>> I've also seen some place where we need to improve in
>>> the TenantAwareLoadBalanceEndpoint class. Here are my observations.
>>>
>>> 1) Five different inner "for-loops". This is a bad smell in the code.
>>>
>>
>> This five different inner 'for-loops' are not in
>> TenantAwareLoadBalanceEndpoint class but in 'LoadBalancerConfiguration'
>> file.
>>
>> And on the top of the method that has five different inner loops, there's
>> a comment as follows (with a FIXME tag):
>>
>>         *// FIXME if possible! I couldn't think of any other way to do
>> this, at this moment.
>>         // Note: some of these for-loops are pretty small, thus no
>> considerable performance overhead.*
>>
>> So, as the comment says, +1  for re-visiting the code and fixing it.
>>
>>  2) We do a registry lookup for each and every unknown host name. This
>>> bit of code is vulnerable to a DOS Attack.
>>>
>> Yes, Understood. Since the newly mapped domains are added to registry
> dynamically, we have to look whether the invalid domain is defined there(In
> Stratos domain mapping scenario).
>
> Possible solution would be keeping the domain mapping in memory and
> persist(For a failover/HA scenario). For that, we need to do web service
> call to ELB or trigger an even to notify ELB. But service hosting facility
> is disabled in ELB AFAIR. So we might be able to use queue subscription to
> pass the message which we already have.
> That way we can avoid using registry and also can gain better performance.
>
> Please explain if there is a better way?
>
>
>> @Lahiru please explain the context behind this.
>>
>>
>>> 3) This code looks more like procedural-oriented code.
>>>
>>>
>> You mean the code in this class??
>>
>>
>>>  Lets do a proper code review on this and refactor the code for the
>>> next release. I've created a Redmine task for this.
>>>
>>
>> +1. We need all the people who contributed to this code, to understand
>> the rationale behind.
>>
>>
>>> Thanks,
>>> Sameera.
>>>
>>>
>>> On Fri, Aug 16, 2013 at 4:43 PM, Afkham Azeez <az...@wso2.com> wrote:
>>>
>>>> There are a number of debug statements which do String concatenations,
>>>> and are not wrapped in log.isDebugEnabled() conditions. Such statements
>>>> will cause unnecessary performance overhead.
>>>>
>>>> --
>>>> *Afkham Azeez*
>>>> Director of Architecture; WSO2, Inc.; http://wso2.com
>>>> Member; Apache Software Foundation; http://www.apache.org/
>>>> * <http://www.apache.org/>**
>>>> email: **az...@wso2.com* <az...@wso2.com>* cell: +94 77 3320919
>>>> blog: **http://blog.afkham.org* <http://blog.afkham.org>*
>>>> twitter: 
>>>> **http://twitter.com/afkham_azeez*<http://twitter.com/afkham_azeez>
>>>> *
>>>> linked-in: **http://lk.linkedin.com/in/afkhamazeez*
>>>> *
>>>> *
>>>> *Lean . Enterprise . Middleware*
>>>>
>>>
>>>
>>>
>>> --
>>> Sameera Jayasoma,
>>> Architect,
>>>
>>> WSO2, Inc. (http://wso2.com)
>>> email: same...@wso2.com
>>> blog: http://sameera.adahas.org
>>> twitter: https://twitter.com/sameerajayasoma
>>> flickr: http://www.flickr.com/photos/sameera-jayasoma/collections
>>>
>>>
>>> Lean . Enterprise . Middleware
>>>
>>
>>
>>
>> --
>>
>> Thanks & regards,
>> Nirmal
>>
>> Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
>> Mobile: +94715779733
>> Blog: http://nirmalfdo.blogspot.com/
>>
>>
>
>
> --
> --
> Lahiru Sandaruwan
> Software Engineer,
> Platform Technologies,
> WSO2 Inc., http://wso2.com
> lean.enterprise.middleware
>
> email: lahi...@wso2.com cell: (+94) 773 325 954
> blog: http://lahiruwrites.blogspot.com/
> twitter: http://twitter.com/lahirus
> linked-in: http://lk.linkedin.com/pub/lahiru-sandaruwan/16/153/146
>
>


-- 

Thanks & regards,
Nirmal

Senior Software Engineer- Platform Technologies Team, WSO2 Inc.
Mobile: +94715779733
Blog: http://nirmalfdo.blogspot.com/

Attachment: wrapDebugLogs.diff
Description: Binary data

_______________________________________________
Dev mailing list
Dev@wso2.org
http://wso2.org/cgi-bin/mailman/listinfo/dev

Reply via email to