[jboss-jira] [JBoss JIRA] Commented: (JBAS-4719) Implementations of Invoker should implement equals as an equality check rather than relying on Object.equals, this is important for cluster fail-over support

Scott Marlow (JIRA) jira-events at lists.jboss.org
Wed Sep 19 09:53:12 EDT 2007


    [ http://jira.jboss.com/jira/browse/JBAS-4719?page=comments#action_12377592 ] 
            
Scott Marlow commented on JBAS-4719:
------------------------------------

Patched PooledInvokerProxy checked into 4.2

> Implementations of Invoker should implement equals as an equality check rather than relying on Object.equals, this is important for cluster fail-over support
> -------------------------------------------------------------------------------------------------------------------------------------------------------------
>
>                 Key: JBAS-4719
>                 URL: http://jira.jboss.com/jira/browse/JBAS-4719
>             Project: JBoss Application Server
>          Issue Type: Bug
>      Security Level: Public(Everyone can see) 
>          Components: Clustering
>    Affects Versions: JBossAS-4.2.0.GA, JBossAS-5.0.0.Beta2, JBossAS-4.0.5.GA, JBossAS-4.0.4.GA
>            Reporter: Scott Marlow
>         Assigned To: Scott Marlow
>             Fix For: JBossAS-4.2.2.GA, JBossAS-5.0.0.CR1
>
>         Attachments: PooledInvokerProxy.patch
>
>
> Part of how JRMPInvokerProxyHA handles fail-over includes removing the reference to the node that left the cluster.  However, the dead node is not removed as an equality check is not implemented by certain Invoker implementations.  
> The relevant code in JRMPInvokerProxyHA is
>    protected void removeDeadTarget(Object target)
>    {
>       if (this.familyClusterInfo != null)
>          this.familyClusterInfo.removeDeadTarget (target);
>    }
> The code in familyClusterInfo is:
>    public ArrayList removeDeadTarget(Object target)
>    {
>       synchronized (this)
>       {
>          ArrayList tmp = (ArrayList) targets.clone();
>          tmp.remove (target);
>          this.targets = tmp;
>          this.isViewMembersInSyncWithViewId = false;
>       }
>       return this.targets;
>    }
> Since, we didn't include an equals test in many of the different Invoker implementations, the above "tmp.remove(target)" operation fails.  The reason for the failure is due to the "targets" ArrayList changing on every invocation (to reflect the current cluster server membership list), a new "targets" is created (so of course comparing references later will not work.)
> A similar problem occurs with the EJB2 load balancers after a cluster membership changes.  
> I think that these issues will be solved by implementing an equals test in the different invokers that can handle equality testing.  
> PooledInvokerProxy should implement equals based on ServerAddress.

-- 
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators: http://jira.jboss.com/jira/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira

        



More information about the jboss-jira mailing list