tomcat-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bugzi...@apache.org
Subject DO NOT REPLY [Bug 42840] New: - AbstractReplicatedMap.ping(timeout) throws ConcurrentModificationException
Date Mon, 09 Jul 2007 09:39:05 GMT
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: tomcat-dev@jakarta.apache.org
        ReportedBy: keiichi.fujino@gmail.com


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: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org


Mime
View raw message