From 0c03dfe8a82e78419da258d886449b7f7b9e9ebf Mon Sep 17 00:00:00 2001 From: evenliu Date: Mon, 4 Mar 2024 17:38:31 +0800 Subject: [PATCH 1/3] add queueRemainingSize at the beginning (#1293) Co-authored-by: liujianjun.ljj --- .../com/alipay/sofa/rpc/boot/common/RpcThreadPoolMonitor.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/common/RpcThreadPoolMonitor.java b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/common/RpcThreadPoolMonitor.java index 8d654f2db..8d5c85e05 100644 --- a/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/common/RpcThreadPoolMonitor.java +++ b/sofa-boot-project/sofa-boot-core/rpc-sofa-boot/src/main/java/com/alipay/sofa/rpc/boot/common/RpcThreadPoolMonitor.java @@ -82,6 +82,8 @@ public void start() { StringBuilder sb = new StringBuilder(); sb.append("coreSize:" + threadPoolExecutor.getCorePoolSize() + ","); sb.append("maxPoolSize:" + threadPoolExecutor.getMaximumPoolSize() + ","); + sb.append("queueRemainingSize:" + + threadPoolExecutor.getQueue().remainingCapacity() + ","); sb.append("keepAliveTime:" + threadPoolExecutor.getKeepAliveTime(TimeUnit.MILLISECONDS) + "\n"); From b4002c41eb2a63510e795560598c25e25220a629 Mon Sep 17 00:00:00 2001 From: HzjNeverStop <441627022@qq.com> Date: Wed, 6 Mar 2024 15:01:48 +0800 Subject: [PATCH 2/3] add spring-boot-configuration-processor in sofa-boot-actuator-autoconfigure model (#1294) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: 致节 --- sofa-boot-project/sofa-boot-actuator-autoconfigure/pom.xml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/sofa-boot-project/sofa-boot-actuator-autoconfigure/pom.xml b/sofa-boot-project/sofa-boot-actuator-autoconfigure/pom.xml index f3ecd8c69..16b1ee9ad 100644 --- a/sofa-boot-project/sofa-boot-actuator-autoconfigure/pom.xml +++ b/sofa-boot-project/sofa-boot-actuator-autoconfigure/pom.xml @@ -30,6 +30,12 @@ spring-boot-actuator-autoconfigure + + org.springframework.boot + spring-boot-configuration-processor + true + + com.alipay.sofa runtime-sofa-boot From 2e8af92ee6cc73e8608b1c6abcff67b4aa5b9aa2 Mon Sep 17 00:00:00 2001 From: HzjNeverStop <441627022@qq.com> Date: Thu, 7 Mar 2024 10:26:57 +0800 Subject: [PATCH 3/3] Fix concuren problem in jvmfilterholder (#1295) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit fix JvmFilterHolder concurrent safe problem --------- Co-authored-by: 致节 --- .../alipay/sofa/runtime/filter/JvmFilterHolder.java | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/sofa-boot-project/sofa-boot-core/runtime-sofa-boot/src/main/java/com/alipay/sofa/runtime/filter/JvmFilterHolder.java b/sofa-boot-project/sofa-boot-core/runtime-sofa-boot/src/main/java/com/alipay/sofa/runtime/filter/JvmFilterHolder.java index 03ffd8d5d..0fd5c9971 100644 --- a/sofa-boot-project/sofa-boot-core/runtime-sofa-boot/src/main/java/com/alipay/sofa/runtime/filter/JvmFilterHolder.java +++ b/sofa-boot-project/sofa-boot-core/runtime-sofa-boot/src/main/java/com/alipay/sofa/runtime/filter/JvmFilterHolder.java @@ -18,9 +18,8 @@ import org.springframework.core.annotation.AnnotationAwareOrderComparator; -import java.util.ArrayList; -import java.util.Collections; import java.util.List; +import java.util.concurrent.CopyOnWriteArrayList; import java.util.concurrent.atomic.AtomicBoolean; /** @@ -31,7 +30,7 @@ */ public class JvmFilterHolder { - private final List JVM_FILTERS = new ArrayList<>(); + private final List JVM_FILTERS = new CopyOnWriteArrayList<>(); private final AtomicBoolean FILTERS_SORTED = new AtomicBoolean(false); @@ -56,8 +55,8 @@ public List getJvmFilters() { } public static boolean beforeInvoking(JvmFilterContext context) { - List filters = Collections.unmodifiableList(context.getSofaRuntimeContext() - .getJvmFilterHolder().getJvmFilters()); + List filters = context.getSofaRuntimeContext().getJvmFilterHolder() + .getJvmFilters(); for (JvmFilter filter : filters) { if (!filter.before(context)) { return false; @@ -67,8 +66,8 @@ public static boolean beforeInvoking(JvmFilterContext context) { } public static boolean afterInvoking(JvmFilterContext context) { - List filters = Collections.unmodifiableList(context.getSofaRuntimeContext() - .getJvmFilterHolder().getJvmFilters()); + List filters = context.getSofaRuntimeContext().getJvmFilterHolder() + .getJvmFilters(); for (int i = filters.size() - 1; i >= 0; --i) { if (!filters.get(i).after(context)) { return false;