You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dubbo.apache.org by al...@apache.org on 2023/09/13 01:54:54 UTC
[dubbo] branch 3.2 updated: fix: AbortPolicyWithReport concurrency issues https://github.com/apache/dubbo/issues/13042 (#13043)
This is an automated email from the ASF dual-hosted git repository.
albumenj pushed a commit to branch 3.2
in repository https://gitbox.apache.org/repos/asf/dubbo.git
The following commit(s) were added to refs/heads/3.2 by this push:
new d9db031469 fix: AbortPolicyWithReport concurrency issues https://github.com/apache/dubbo/issues/13042 (#13043)
d9db031469 is described below
commit d9db031469c27eb2e1c7438cf92e217b7f6817c4
Author: GiraffeTree <15...@163.com>
AuthorDate: Wed Sep 13 09:54:48 2023 +0800
fix: AbortPolicyWithReport concurrency issues https://github.com/apache/dubbo/issues/13042 (#13043)
---
.../dubbo/common/threadpool/support/AbortPolicyWithReport.java | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReport.java b/dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReport.java
index 8bb3bbfe51..8163b2b0b1 100644
--- a/dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReport.java
+++ b/dubbo-common/src/main/java/org/apache/dubbo/common/threadpool/support/AbortPolicyWithReport.java
@@ -145,6 +145,10 @@ public class AbortPolicyWithReport extends ThreadPoolExecutor.AbortPolicy {
if (!guard.tryAcquire()) {
return;
}
+ // To avoid multiple dump, check again
+ if (System.currentTimeMillis() - lastPrintTime < TEN_MINUTES_MILLS) {
+ return;
+ }
ExecutorService pool = Executors.newSingleThreadExecutor();
pool.execute(() -> {
@@ -169,9 +173,9 @@ public class AbortPolicyWithReport extends ThreadPoolExecutor.AbortPolicy {
} catch (Exception t) {
logger.error(COMMON_UNEXPECTED_CREATE_DUMP, "", "", "dump jStack error", t);
} finally {
+ lastPrintTime = System.currentTimeMillis();
guard.release();
}
- lastPrintTime = System.currentTimeMillis();
});
//must shutdown thread pool ,if not will lead to OOM
pool.shutdown();