You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ratis.apache.org by wi...@apache.org on 2025/01/09 11:16:27 UTC
(ratis) 05/14: RATIS-2194. FileLock didn't unlock properly (#1183)
This is an automated email from the ASF dual-hosted git repository.
williamsong pushed a commit to branch release-3.1.3
in repository https://gitbox.apache.org/repos/asf/ratis.git
commit 3c21b97d8c80a0cd54ca884eb802646559c24e73
Author: Chung En Lee <wf...@gmail.com>
AuthorDate: Wed Nov 27 07:45:18 2024 +0800
RATIS-2194. FileLock didn't unlock properly (#1183)
---
.../java/org/apache/ratis/server/impl/RaftServerProxy.java | 13 +++++++------
1 file changed, 7 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 84221cfcf..242bb377b 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,6 +415,13 @@ class RaftServerProxy implements RaftServer {
public void close() {
lifeCycle.checkStateAndClose(() -> {
LOG.info("{}: close", getId());
+
+ try {
+ ConcurrentUtils.shutdownAndWait(implExecutor.get());
+ } catch (Exception ignored) {
+ LOG.warn(getId() + ": Failed to shutdown implExecutor", ignored);
+ }
+
impls.close();
try {
@@ -429,12 +436,6 @@ class RaftServerProxy implements RaftServer {
LOG.warn(getId() + ": Failed to close " + SupportedDataStreamType.NETTY + " server", ignored);
}
- try {
- ConcurrentUtils.shutdownAndWait(implExecutor.get());
- } catch (Exception ignored) {
- LOG.warn(getId() + ": Failed to shutdown implExecutor", ignored);
- }
-
try {
ConcurrentUtils.shutdownAndWait(executor.get());
} catch (Exception ignored) {