[ 
https://issues.apache.org/jira/browse/HDFS-5028?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13723253#comment-13723253
 ] 

zhaoyunjiong commented on HDFS-5028:
------------------------------------

dfsclients was syncronizing.
The problem here is Iterator.
You can get more information here:
http://stackoverflow.com/questions/8189466/java-util-concurrentmodificationexception

For short:
The iterators returned by this class's iterator and listIterator methods are 
fail-fast: if the list is structurally modified at any time after the iterator 
is created, in any way except through the iterator's own remove or add methods, 
the iterator will throw a ConcurrentModificationException.

c.abort() will remove c(a dfsclient) from dfsclients, so iterator generated in 
"for(DFSClient c : dfsclients)" will throw ConcurrentModificationException.
                
> LeaseRenewer throw java.util.ConcurrentModificationException when timeout
> -------------------------------------------------------------------------
>
>                 Key: HDFS-5028
>                 URL: https://issues.apache.org/jira/browse/HDFS-5028
>             Project: Hadoop HDFS
>          Issue Type: Bug
>    Affects Versions: 1.1.0, 2.0.0-alpha
>            Reporter: zhaoyunjiong
>             Fix For: 1.1.3
>
>         Attachments: HDFS-5028-branch-1.1.patch, HDFS-5028.patch
>
>
> In LeaseRenewer, when renew() throw SocketTimeoutException, c.abort() will 
> remove one dfsclient from dfsclients. Here will throw a 
> ConcurrentModificationException because dfsclients changed after the iterator 
> created by "for(DFSClient c : dfsclients)":
> Exception in thread "org.apache.hadoop.hdfs.LeaseRenewer$1@75fa1077" 
> java.util.ConcurrentModificationException
>         at 
> java.util.AbstractList$Itr.checkForComodification(AbstractList.java:372)
>         at java.util.AbstractList$Itr.next(AbstractList.java:343)
>         at org.apache.hadoop.hdfs.LeaseRenewer.run(LeaseRenewer.java:406)
>         at 
> org.apache.hadoop.hdfs.LeaseRenewer.access$600(LeaseRenewer.java:69)
>         at org.apache.hadoop.hdfs.LeaseRenewer$1.run(LeaseRenewer.java:273)
>         at java.lang.Thread.run(Thread.java:662)

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira

Reply via email to