DO NOT REPLY TO THIS EMAIL, BUT PLEASE POST YOUR BUGĀ·
RELATED COMMENTS THROUGH THE WEB INTERFACE AVAILABLE AT
<http://issues.apache.org/bugzilla/show_bug.cgi?id=42840>.
ANY REPLY MADE TO THIS MESSAGE WILL NOT BE COLLECTED ANDĀ·
INSERTED IN THE BUG DATABASE.

http://issues.apache.org/bugzilla/show_bug.cgi?id=42840

           Summary: AbstractReplicatedMap.ping(timeout) throws
                    ConcurrentModificationException
           Product: Tomcat 6
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Catalina
        AssignedTo: [EMAIL PROTECTED]
        ReportedBy: [EMAIL PROTECTED]


I noticed the following codes. 

org.apache.catalina.tribes.tipis.AbstractReplicatedMap.ping(long timeout) is 
as follows.

   protected void ping(long timeout) throws ChannelException {
      
      .... omits 
      
       //update our map of members, expire some if we didn't receive a ping 
back
       synchronized (mapMembers) {
           Iterator it = mapMembers.entrySet().iterator();
           long now = System.currentTimeMillis();
           while ( it.hasNext() ) {
               Map.Entry entry = (Map.Entry)it.next();
               long access = ((Long)entry.getValue()).longValue(); 
               if ( (now - access) > timeout ) memberDisappeared((Member)
entry.getKey());
           }
       }//synch
   }
   
(now - access) If > timeout is ture, memberDisappeared((Member)entry.getKey()) 
is executed. 
And org.apache.catalina.tribes.tipis.AbstractReplicatedMap.memberDisappeared
(Member member) is as follows.  

   public void memberDisappeared(Member member) {
       boolean removed = false;
       synchronized (mapMembers) {
           removed = (mapMembers.remove(member) != null );
       }
       
       .... omits 
       
    }
   
member(argument) is removeed from mapMembers(instance of HashMap). 

As a result, when The 258th line Map.Entry entry=(Map.Entry) it.next() is 
executed again, 
java.util.ConcurrentModificationException is thrown.

-- 
Configure bugmail: http://issues.apache.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to