From c04a7d974aa5ae2589d36f63c4ac45fb42cd1b80 Mon Sep 17 00:00:00 2001 From: Tsz-wo Sze Date: Fri, 2 Aug 2013 07:08:35 +0000 Subject: [PATCH] HDFS-5028. LeaseRenewer throws ConcurrentModificationException when timeout. Contributed by zhaoyunjiong git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1509565 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt | 3 +++ .../src/main/java/org/apache/hadoop/hdfs/LeaseRenewer.java | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt index 21b5f79616..546fcef3e6 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt +++ b/hadoop-hdfs-project/hadoop-hdfs/CHANGES.txt @@ -288,6 +288,9 @@ Release 2.1.1-beta - UNRELEASED BUG FIXES + HDFS-5028. LeaseRenewer throws ConcurrentModificationException when timeout. + (zhaoyunjiong via szetszwo) + Release 2.1.0-beta - 2013-08-06 INCOMPATIBLE CHANGES diff --git a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/LeaseRenewer.java b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/LeaseRenewer.java index 8f3b8fb0e3..24bdc2e05d 100644 --- a/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/LeaseRenewer.java +++ b/hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/LeaseRenewer.java @@ -449,8 +449,8 @@ private void run(final int id) throws InterruptedException { LOG.warn("Failed to renew lease for " + clientsString() + " for " + (elapsed/1000) + " seconds. Aborting ...", ie); synchronized (this) { - for(DFSClient c : dfsclients) { - c.abort(); + while (!dfsclients.isEmpty()) { + dfsclients.get(0).abort(); } } break;