On Thu, Apr 25, 2013 at 11:45 PM, Nirmal Fernando <[email protected]> wrote:
> Hi All,
>
> Found a bug in SubDomainAwareGroupManagementAgent.
>
> Here's the scenario.
>
>
> - Assume that the back-end node Member (*M*) doesn't have a 'sub
> domain' property and then the 'subDomain' value will be *null*.
>
>
AFAICR, if sub-domain is not specified in the backend node, the code
explicitly assigns such a node to the default subdomain __$default . So, no
node will advertise its subdomain as null. At least this is how I remember
implementing it.
>
> - In ELB, say, there's a SubDomainAwareGroupManagementAgent for domain
> '*x*' and sub domain '*y*'.
> - According to the current code member '*M*' will get added to the
> SubDomainAwareGroupManagementAgent which represents a cluster having a sub
> domain '*y*'. Which is wrong IMO.
>
> Hence, following is the fix I propose [1].
>
> So, in brief, if a Member has not specified a sub domain property, it
> should *considered* to be added to the matching cluster, if and only if
> the SubDomainAwareGroupManagementAgent's sub domain is __$default (which is
> the default sub domain.)
>
> [1]
>
> /**
> * This GroupManagementAgent can handle group membership based on cluster
> sub-domains.
> @@ -34,7 +35,8 @@
> @Override
> public void applicationMemberAdded(Member member) {
> String subDomain =
> member.getProperties().getProperty("subDomain");
> - if (subDomain == null || subDomain.equals(this.subDomain)) {
> + if ((subDomain == null &&
> Constants.DEFAULT_SUB_DOMAIN.equals(this.subDomain)) ||
> + subDomain.equals(this.subDomain)) {
> super.applicationMemberAdded(member);
> }
> }
> @@ -42,7 +44,8 @@
> @Override
> public void applicationMemberRemoved(Member member) {
> String subDomain =
> member.getProperties().getProperty("subDomain");
> - if (subDomain == null || subDomain.equals(this.subDomain)) {
> + if ((subDomain == null &&
> Constants.DEFAULT_SUB_DOMAIN.equals(this.subDomain)) ||
> + subDomain.equals(this.subDomain)) {
> super.applicationMemberRemoved(member);
> }
> }
>
>
> --
>
> Thanks & regards,
> Nirmal
>
> Software Engineer- Platform Technologies Team, WSO2 Inc.
> Mobile: +94715779733
> Blog: http://nirmalfdo.blogspot.com/
>
> <http://nirmalfdo.blogspot.com/>
>
--
*Afkham Azeez*
Director of Architecture; WSO2, Inc.; http://wso2.com
Member; Apache Software Foundation; http://www.apache.org/
* <http://www.apache.org/>**
email: **[email protected]* <[email protected]>* 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*
_______________________________________________
Dev mailing list
[email protected]
http://wso2.org/cgi-bin/mailman/listinfo/dev