Skip to content

Commit 2fb137a

Browse files
committed
shutdown getBlockExecutor processBlockExecutor now
1 parent fdc00de commit 2fb137a

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

common/src/main/java/org/tron/common/es/ExecutorServiceManager.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,15 @@ public static void shutdownAndAwaitTermination(ExecutorService pool, String name
8484
logger.info("Pool {} shutdown done", name);
8585
}
8686

87+
public static void shutdownNow(ExecutorService pool, String name) {
88+
if (pool == null) {
89+
return;
90+
}
91+
logger.info("Pool {} shutdown...", name);
92+
pool.shutdownNow();
93+
logger.info("Pool {} shutdown done", name);
94+
}
95+
8796
public static Future<?> submit(ExecutorService es, Runnable task) {
8897
return es.submit(() -> {
8998
try {

framework/src/main/java/org/tron/program/SolidityNode.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,8 +72,8 @@ public void onApplicationEvent(ContextClosedEvent event) {
7272
@PreDestroy
7373
private void shutdown() {
7474
flag = false;
75-
ExecutorServiceManager.shutdownAndAwaitTermination(getBlockExecutor, getBlockName);
76-
ExecutorServiceManager.shutdownAndAwaitTermination(processBlockExecutor, processBlockName);
75+
ExecutorServiceManager.shutdownNow(getBlockExecutor, getBlockName);
76+
ExecutorServiceManager.shutdownNow(processBlockExecutor, processBlockName);
7777
if (databaseGrpcClient != null) {
7878
databaseGrpcClient.shutdown();
7979
}

0 commit comments

Comments
 (0)