From 2c04107f2bb76944f1759ba7a71de56347d8a2bf Mon Sep 17 00:00:00 2001 From: "pingyong.xpy" Date: Sat, 15 Jul 2017 10:56:13 +0800 Subject: [PATCH] [FLINK-7201] fix concurrency in JobLeaderIdService when shutdown the ResourceManager --- .../runtime/resourcemanager/ResourceManager.java | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java b/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java index d2e0222e65b9f..2641728b45126 100644 --- a/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java +++ b/flink-runtime/src/main/java/org/apache/flink/runtime/resourcemanager/ResourceManager.java @@ -207,6 +207,12 @@ public void start() throws Exception { public void shutDown() throws Exception { Exception exception = null; + try { + super.shutDown(); + } catch (Exception e) { + exception = ExceptionUtils.firstOrSuppressed(e, exception); + } + taskManagerHeartbeatManager.stop(); jobManagerHeartbeatManager.stop(); @@ -223,12 +229,6 @@ public void shutDown() throws Exception { exception = ExceptionUtils.firstOrSuppressed(e, exception); } - try { - super.shutDown(); - } catch (Exception e) { - exception = ExceptionUtils.firstOrSuppressed(e, exception); - } - clearState(); if (exception != null) {