tez-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ss...@apache.org
Subject [2/2] tez git commit: TEZ-3625. Dag.getVertex should obtain a readlock. (sseth)
Date Thu, 16 Feb 2017 04:30:21 GMT
TEZ-3625. Dag.getVertex should obtain a readlock. (sseth)


Project: http://git-wip-us.apache.org/repos/asf/tez/repo
Commit: http://git-wip-us.apache.org/repos/asf/tez/commit/dcae5e42
Tree: http://git-wip-us.apache.org/repos/asf/tez/tree/dcae5e42
Diff: http://git-wip-us.apache.org/repos/asf/tez/diff/dcae5e42

Branch: refs/heads/master
Commit: dcae5e42e961a6b2fd0e82a2392d601ca935d0f1
Parents: 2268c72
Author: Siddharth Seth <sseth@apache.org>
Authored: Wed Feb 15 20:30:06 2017 -0800
Committer: Siddharth Seth <sseth@apache.org>
Committed: Wed Feb 15 20:30:06 2017 -0800

----------------------------------------------------------------------
 CHANGES.txt                                                   | 1 +
 .../src/main/java/org/apache/tez/dag/app/DAGAppMaster.java    | 1 +
 .../main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java    | 7 ++++++-
 3 files changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/tez/blob/dcae5e42/CHANGES.txt
----------------------------------------------------------------------
diff --git a/CHANGES.txt b/CHANGES.txt
index a3323b9..c505964 100644
--- a/CHANGES.txt
+++ b/CHANGES.txt
@@ -7,6 +7,7 @@ INCOMPATIBLE CHANGES
 
 ALL CHANGES:
 
+  TEZ-3625. Dag.getVertex should obtain a readlock.
   TEZ-3624. Split multiple calls on the same line in TaskCommunicatorContextImpl.
   TEZ-3550. Provide access to sessionId/dagId via DagClient.
   TEZ-3267. Publish queue name to ATS as part of dag summary.

http://git-wip-us.apache.org/repos/asf/tez/blob/dcae5e42/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
index 7f27064..5a43358 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/DAGAppMaster.java
@@ -2627,6 +2627,7 @@ public class DAGAppMaster extends AbstractService {
 
     // Send out an event to inform components that a new DAG has been submitted.
     // Information about this DAG is available via the context.
+    // This event may be processed after DAG_INIT, but will be processed before DAG_START
     sendEvent(new DAGAppMasterEvent(DAGAppMasterEventType.NEW_DAG_SUBMITTED));
     // create a job event for job initialization
     DAGEvent initDagEvent = new DAGEvent(currentDAG.getID(), DAGEventType.DAG_INIT);

http://git-wip-us.apache.org/repos/asf/tez/blob/dcae5e42/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java
----------------------------------------------------------------------
diff --git a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java
index 481353b..047fea6 100644
--- a/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java
+++ b/tez-dag/src/main/java/org/apache/tez/dag/app/dag/impl/DAGImpl.java
@@ -1810,7 +1810,12 @@ public class DAGImpl implements org.apache.tez.dag.app.dag.DAG,
 
   @Override
   public Vertex getVertex(String vertexName) {
-    return vertexMap.get(vertexName);
+    this.readLock.lock();
+    try {
+      return vertexMap.get(vertexName);
+    } finally {
+      this.readLock.unlock();
+    }
   }
 
   private void mayBeConstructFinalFullCounters() {


Mime
View raw message