You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by dr...@apache.org on 2022/08/29 02:51:45 UTC

[ratis] 05/05: RATIS-1691. Potential deadlock in server shutdown (#729)

This is an automated email from the ASF dual-hosted git repository.

dragonyliu pushed a commit to branch release-2.4.0
in repository https://gitbox.apache.org/repos/asf/ratis.git

commit 059b24b08089a4926ad36addb28354c8750add96
Author: Doroszlai, Attila <64...@users.noreply.github.com>
AuthorDate: Sat Aug 27 09:27:55 2022 +0200

    RATIS-1691. Potential deadlock in server shutdown (#729)
    
    (cherry picked from commit 62edc69ebc46d7ac2871fb815c2f86ab4c3e933f)
---
 .../java/org/apache/ratis/server/impl/RaftServerProxy.java   | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java b/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java
index ad488f53b..0825e7d12 100644
--- a/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java
+++ b/ratis-server/src/main/java/org/apache/ratis/server/impl/RaftServerProxy.java
@@ -415,14 +415,14 @@ class RaftServerProxy implements RaftServer {
       } catch (IOException ignored) {
         LOG.warn(getId() + ": Failed to close " + SupportedDataStreamType.NETTY + " server", ignored);
       }
+
+      try {
+        ConcurrentUtils.shutdownAndWait(executor);
+      } catch (Exception ignored) {
+        LOG.warn(getId() + ": Failed to shutdown executor", ignored);
+      }
     });
     pauseMonitor.stop();
-
-    try {
-      ConcurrentUtils.shutdownAndWait(executor);
-    } catch (Exception ignored) {
-      LOG.warn(getId() + ": Failed to shutdown executor", ignored);
-    }
   }
 
   @Override