From 5cd037907f185a31b28810d26e582647ab3c196e Mon Sep 17 00:00:00 2001 From: wardseptember Date: Thu, 26 Sep 2024 20:29:24 +0800 Subject: [PATCH] bugfix: adjust the timing of closing all threads (#66) --- .../java/com/tencent/trpc/core/common/ConfigManager.java | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/trpc-core/src/main/java/com/tencent/trpc/core/common/ConfigManager.java b/trpc-core/src/main/java/com/tencent/trpc/core/common/ConfigManager.java index ecbc1e167f..cc0be7fd7e 100644 --- a/trpc-core/src/main/java/com/tencent/trpc/core/common/ConfigManager.java +++ b/trpc-core/src/main/java/com/tencent/trpc/core/common/ConfigManager.java @@ -369,16 +369,16 @@ protected void stopInternal() throws Exception { } // 2) wait waitTime before stop service Thread.sleep(waitTime); - // 3) wait for threads to close - WorkerPoolManager.shutdown(closeTime, TimeUnit.MILLISECONDS); - // 4) service stop, do not accept new requests + // 3) service stop, do not accept new requests if (serverConfig != null) { serverConfig.stop(); } - // 5) business-related + // 4) business-related if (appInitializer != null) { appInitializer.stop(); } + // 5) wait for threads to close + WorkerPoolManager.shutdown(closeTime, TimeUnit.MILLISECONDS); // 6) close the client side clientConfig.stop(); // 7) close plugins