Skip to content

Commit 1ed4fc5

Browse files
authored
[server] Last close ZookeeperClient to prevent exceptions (#2018)
1 parent babf91b commit 1ed4fc5

File tree

3 files changed

+4
-9
lines changed

3 files changed

+4
-9
lines changed

fluss-server/src/main/java/org/apache/fluss/server/authorizer/DefaultAuthorizer.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -159,10 +159,6 @@ public void startup() throws Exception {
159159

160160
@Override
161161
public void close() {
162-
if (zooKeeperClient != null) {
163-
zooKeeperClient.close();
164-
}
165-
166162
if (aclChangeNotificationWatcher != null) {
167163
aclChangeNotificationWatcher.stop();
168164
}

fluss-server/src/main/java/org/apache/fluss/server/authorizer/ZkNodeChangeNotificationWatcher.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ public void stop() {
9191
return;
9292
}
9393
running = false;
94-
LOG.info("Stopping TableChangeWatcher");
94+
LOG.info("Stopping ZkNodeChangeNotificationWatcher");
9595
curatorCache.close();
9696
}
9797

fluss-server/src/main/java/org/apache/fluss/server/tablet/TabletServer.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -382,10 +382,6 @@ CompletableFuture<Void> stopServices() {
382382
}
383383

384384
try {
385-
if (zkClient != null) {
386-
zkClient.close();
387-
}
388-
389385
// TODO currently, rpc client don't have timeout logic. After implementing the
390386
// timeout logic, we need to move the closure of rpc client to after the closure of
391387
// replica manager.
@@ -431,6 +427,9 @@ CompletableFuture<Void> stopServices() {
431427
lakeCatalogDynamicLoader.close();
432428
}
433429

430+
if (zkClient != null) {
431+
zkClient.close();
432+
}
434433
} catch (Throwable t) {
435434
exception = ExceptionUtils.firstOrSuppressed(t, exception);
436435
}

0 commit comments

Comments
 (0)