Repository: tez
Updated Branches:
refs/heads/branch-0.7 8eb707e4e -> 5b03015a4
TEZ-3413. ConcurrentModificationException in HistoryEventTimelineConversion for
AppLaunchedEvent. (Jonathan Eagles via jlowe)
(cherry picked from commit 1468457e671dfcf2780cf17d2655e086aef120c9)
Conflicts:
CHANGES.txt
tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java
Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/5b03015a
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/5b03015a
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/5b03015a
Branch: refs/heads/branch-0.7
Commit: 5b03015a466ed1ee9f7797569e176d58e68abbcd
Parents: 8eb707e
Author: Jason Lowe <[email protected]>
Authored: Wed Aug 17 15:47:27 2016 +0000
Committer: Jason Lowe <[email protected]>
Committed: Wed Aug 17 15:47:27 2016 +0000
----------------------------------------------------------------------
CHANGES.txt | 1 +
.../apache/tez/dag/history/utils/DAGUtils.java | 3 +-
.../ats/TestHistoryEventTimelineConversion.java | 34 ++++++++++++++++++++
3 files changed, 37 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/tez/blob/5b03015a/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index 4626e93..6037ae8 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@ INCOMPATIBLE CHANGES
ALL CHANGES:
+ TEZ-3413. ConcurrentModificationException in HistoryEventTimelineConversion
for AppLaunchedEvent.
TEZ-3286. Allow clients to set processor reserved memory per vertex (instead
of per container).
TEZ-3223. Support a NullHistoryLogger to disable history logging if needed.
TEZ-3293. Fetch failures can cause a shuffle hang waiting for memory merge
that never starts.
http://git-wip-us.apache.org/repos/asf/tez/blob/5b03015a/tez-dag/src/main/java/org/apache/tez/dag/history/utils/DAGUtils.java
----------------------------------------------------------------------
diff --git
a/tez-dag/src/main/java/org/apache/tez/dag/history/utils/DAGUtils.java
b/tez-dag/src/main/java/org/apache/tez/dag/history/utils/DAGUtils.java
index 781120c..0f2a970 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/history/utils/DAGUtils.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/history/utils/DAGUtils.java
@@ -446,7 +446,8 @@ public class DAGUtils {
}
public static Map<String, String> convertConfigurationToATSMap(Configuration
conf) {
- Iterator<Entry<String, String>> iter = conf.iterator();
+ // Copy configuration to avoid CME since iterator is not thread safe until
HADOOP-13500
+ Iterator<Entry<String, String>> iter = new Configuration(conf).iterator();
Map<String, String> atsConf = new TreeMap<String, String>();
while (iter.hasNext()) {
Entry<String, String> entry = iter.next();
http://git-wip-us.apache.org/repos/asf/tez/blob/5b03015a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java
----------------------------------------------------------------------
diff --git
a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java
b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java
index e4b4990..3cac986 100644
---
a/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java
+++
b/tez-plugins/tez-yarn-timeline-history/src/test/java/org/apache/tez/dag/history/logging/ats/TestHistoryEventTimelineConversion.java
@@ -23,6 +23,7 @@ import java.util.List;
import java.util.Map;
import java.util.Random;
import java.util.Set;
+import java.util.concurrent.atomic.AtomicBoolean;
import org.apache.hadoop.conf.Configuration;
import org.apache.hadoop.yarn.api.records.ApplicationAttemptId;
@@ -234,6 +235,39 @@ public class TestHistoryEventTimelineConversion {
}
@Test(timeout = 5000)
+ public void testConvertAppLaunchedEventConcurrentModificationException()
+ throws InterruptedException {
+ long launchTime = random.nextLong();
+ long submitTime = random.nextLong();
+ final Configuration conf = new Configuration(false);
+ conf.set("foo", "bar");
+ conf.set("applicationId", "1234");
+ final AtomicBoolean shutdown = new AtomicBoolean(false);
+
+ Thread confChanger = new Thread() {
+ @Override
+ public void run() {
+ int i = 1;
+ while (!shutdown.get()) {
+ // trigger an actual change to test concurrency with
Configuration#iterator
+ conf.set("test" + i++, "test");
+ }
+ }
+ };
+
+ confChanger.start();
+ try {
+ MockVersionInfo mockVersionInfo = new MockVersionInfo();
+ AppLaunchedEvent event = new AppLaunchedEvent(applicationId, launchTime,
+ submitTime, user, conf, mockVersionInfo);
+ HistoryEventTimelineConversion.convertToTimelineEntity(event);
+ } finally {
+ shutdown.set(true);
+ confChanger.join();
+ }
+ }
+
+ @Test(timeout = 5000)
public void testConvertAppLaunchedEvent() {
long launchTime = random.nextLong();
long submitTime = random.nextLong();