提交 283f5efd 编写于 作者: Z zhangminglei 提交者: zentol

[FLINK-6143] [clients] Fix unprotected access to this.flink in LocalExecutor#endSession.

This closes #3710.
上级 705938e5
......@@ -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));
}
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册