Skip to content

Commit 5cd0379

Browse files
bugfix: adjust the timing of closing all threads (#66)
1 parent 9018c10 commit 5cd0379

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

trpc-core/src/main/java/com/tencent/trpc/core/common/ConfigManager.java

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -369,16 +369,16 @@ protected void stopInternal() throws Exception {
369369
}
370370
// 2) wait waitTime before stop service
371371
Thread.sleep(waitTime);
372-
// 3) wait for threads to close
373-
WorkerPoolManager.shutdown(closeTime, TimeUnit.MILLISECONDS);
374-
// 4) service stop, do not accept new requests
372+
// 3) service stop, do not accept new requests
375373
if (serverConfig != null) {
376374
serverConfig.stop();
377375
}
378-
// 5) business-related
376+
// 4) business-related
379377
if (appInitializer != null) {
380378
appInitializer.stop();
381379
}
380+
// 5) wait for threads to close
381+
WorkerPoolManager.shutdown(closeTime, TimeUnit.MILLISECONDS);
382382
// 6) close the client side
383383
clientConfig.stop();
384384
// 7) close plugins

0 commit comments

Comments
 (0)