[hotfix] Correct shutdown order of RestClusterClient

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

Branch: refs/heads/release-1.5
Commit: ea920efc64254b16322bb1d13b5ab1c8633cbda7
Parents: f0d4b3c
Author: Till Rohrmann <trohrm...@apache.org>
Authored: Thu Mar 1 18:21:19 2018 +0100
Committer: Till Rohrmann <trohrm...@apache.org>
Committed: Fri Mar 2 08:53:51 2018 +0100

----------------------------------------------------------------------
 .../flink/client/program/rest/RestClusterClient.java  | 14 +++++++-------
 1 file changed, 7 insertions(+), 7 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/flink/blob/ea920efc/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
----------------------------------------------------------------------
diff --git 
a/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
 
b/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
index 9833296..976f2a4 100644
--- 
a/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
+++ 
b/flink-clients/src/main/java/org/apache/flink/client/program/rest/RestClusterClient.java
@@ -192,13 +192,6 @@ public class RestClusterClient<T> extends ClusterClient<T> 
{
 
        @Override
        public void shutdown() {
-               try {
-                       // we only call this for legacy reasons to shutdown 
components that are started in the ClusterClient constructor
-                       super.shutdown();
-               } catch (Exception e) {
-                       log.error("An error occurred during the client 
shutdown.", e);
-               }
-
                
ExecutorUtils.gracefulShutdown(restClusterClientConfiguration.getRetryDelay(), 
TimeUnit.MILLISECONDS, retryExecutorService);
 
                this.restClient.shutdown(Time.seconds(5));
@@ -215,6 +208,13 @@ public class RestClusterClient<T> extends ClusterClient<T> 
{
                } catch (Exception e) {
                        log.error("An error occurred during stopping the 
dispatcherLeaderRetriever", e);
                }
+
+               try {
+                       // we only call this for legacy reasons to shutdown 
components that are started in the ClusterClient constructor
+                       super.shutdown();
+               } catch (Exception e) {
+                       log.error("An error occurred during the client 
shutdown.", e);
+               }
        }
 
        @Override

Reply via email to