This is an automated email from the ASF dual-hosted git repository. dragonyliu pushed a commit to branch branch-2 in repository https://gitbox.apache.org/repos/asf/ratis.git
commit 3ce2c594913288f864e6dee241f41fbd3a76972c Author: Doroszlai, Attila <[email protected]> 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
