hadoop-common-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From weic...@apache.org
Subject [hadoop] branch branch-3.1 updated: HADOOP-15865. ConcurrentModificationException in Configuration.overlay() method. Contributed by Oleksandr Shevchenko.
Date Tue, 01 Oct 2019 00:32:41 GMT
This is an automated email from the ASF dual-hosted git repository.

weichiu pushed a commit to branch branch-3.1
in repository https://gitbox.apache.org/repos/asf/hadoop.git


The following commit(s) were added to refs/heads/branch-3.1 by this push:
     new 72ef752  HADOOP-15865. ConcurrentModificationException in Configuration.overlay()
method. Contributed by Oleksandr Shevchenko.
72ef752 is described below

commit 72ef752876347dead099ba31f8bbf63ff0f60c6e
Author: Wei-Chiu Chuang <weichiu@apache.org>
AuthorDate: Thu Aug 1 19:56:51 2019 -0700

    HADOOP-15865. ConcurrentModificationException in Configuration.overlay() method. Contributed
by Oleksandr Shevchenko.
    
    (cherry picked from commit e872ceb810a343da7fce7185dca78d3b9aad9b7b)
    (cherry picked from commit 46e72775f5b2156f49b15beac8bffff9cd5aad7f)
---
 .../src/main/java/org/apache/hadoop/conf/Configuration.java         | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
index 8a9aee6..72beb92 100644
--- a/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
+++ b/hadoop-common-project/hadoop-common/src/main/java/org/apache/hadoop/conf/Configuration.java
@@ -3395,8 +3395,10 @@ public class Configuration implements Iterable<Map.Entry<String,String>>,
   }
 
   private void overlay(Properties to, Properties from) {
-    for (Entry<Object, Object> entry: from.entrySet()) {
-      to.put(entry.getKey(), entry.getValue());
+    synchronized (from) {
+      for (Entry<Object, Object> entry : from.entrySet()) {
+        to.put(entry.getKey(), entry.getValue());
+      }
     }
   }
 


---------------------------------------------------------------------
To unsubscribe, e-mail: common-commits-unsubscribe@hadoop.apache.org
For additional commands, e-mail: common-commits-help@hadoop.apache.org


Mime
View raw message