flink-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ches...@apache.org
Subject [7/7] flink git commit: [FLINK-6143] [clients] Fix unprotected access to this.flink in LocalExecutor#endSession.
Date Sat, 15 Apr 2017 17:50:19 GMT
[FLINK-6143] [clients] Fix unprotected access to this.flink in LocalExecutor#endSession.

This closes #3710.


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

Branch: refs/heads/master
Commit: 283f5efd50bdb3e94cc947d1edab6fc0c8cbc77e
Parents: 705938e
Author: zhangminglei <zml13856086071@163.com>
Authored: Tue Apr 11 23:29:50 2017 +0800
Committer: zentol <chesnay@apache.org>
Committed: Sat Apr 15 17:16:26 2017 +0200

----------------------------------------------------------------------
 .../java/org/apache/flink/client/LocalExecutor.java   | 14 +++++++++-----
 1 file changed, 9 insertions(+), 5 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/283f5efd/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java
----------------------------------------------------------------------
diff --git a/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java b/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java
index e0367a5..20a3366 100644
--- a/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java
+++ b/flink-clients/src/main/java/org/apache/flink/client/LocalExecutor.java
@@ -132,7 +132,9 @@ public class LocalExecutor extends PlanExecutor {
 
 	@Override
 	public boolean isRunning() {
-		return flink != null;
+		synchronized (lock) {
+			return flink != null;
+		}
 	}
 
 	/**
@@ -218,10 +220,12 @@ public class LocalExecutor extends PlanExecutor {
 
 	@Override
 	public void endSession(JobID jobID) throws Exception {
-		LocalFlinkMiniCluster flink = this.flink;
-		if (flink != null) {
-			ActorGateway leaderGateway = flink.getLeaderGateway(AkkaUtils.getDefaultTimeoutAsFiniteDuration());
-			leaderGateway.tell(new JobManagerMessages.RemoveCachedJob(jobID));
+		synchronized (LocalExecutor.class) {
+			LocalFlinkMiniCluster flink = this.flink;
+			if (flink != null) {
+				ActorGateway leaderGateway = flink.getLeaderGateway(AkkaUtils.getDefaultTimeoutAsFiniteDuration());
+				leaderGateway.tell(new JobManagerMessages.RemoveCachedJob(jobID));
+			}
 		}
 	}
 


Mime
View raw message