Skip to content

Commit

Permalink
Merge branch '3.2' of https://github.com/apache/dubbo into 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
wxbty committed Jan 9, 2024
2 parents 20e0b57 + 670f997 commit edf00b3
Showing 1 changed file with 10 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -156,13 +156,13 @@ private void dumpJStack() {
if (!guard.tryAcquire()) {
return;
}
// To avoid multiple dump, check again
if (System.currentTimeMillis() - lastPrintTime < TEN_MINUTES_MILLS) {
return;
}

ExecutorService pool = Executors.newSingleThreadExecutor();
ExecutorService pool = null;
try {
// To avoid multiple dump, check again
if (System.currentTimeMillis() - lastPrintTime < TEN_MINUTES_MILLS) {
return;
}
pool = Executors.newSingleThreadExecutor();
pool.execute(() -> {
String dumpPath = getDumpPath();

Expand All @@ -186,12 +186,14 @@ private void dumpJStack() {
logger.error(COMMON_UNEXPECTED_CREATE_DUMP, "", "", "dump jStack error", t);
} finally {
lastPrintTime = System.currentTimeMillis();
guard.release();
}
});
} finally {
guard.release();
// must shutdown thread pool ,if not will lead to OOM
pool.shutdown();
if (pool != null) {
pool.shutdown();
}
}
}

Expand Down

0 comments on commit edf00b3

Please sign in to comment.