diff --git a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadPoolBuilder.java b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadPoolBuilder.java index e54d8e73..7680b9d4 100644 --- a/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadPoolBuilder.java +++ b/hippo4j-core/src/main/java/cn/hippo4j/core/executor/support/ThreadPoolBuilder.java @@ -112,6 +112,9 @@ public class ThreadPoolBuilder implements Builder { public ThreadPoolBuilder maxPoolNum(int maxPoolSize) { this.maxPoolSize = maxPoolSize; + if (maxPoolSize < this.corePoolSize) { + this.corePoolSize = maxPoolSize; + } return this; } @@ -228,6 +231,7 @@ public class ThreadPoolBuilder implements Builder { /** * Create dynamic thread pool by thread pool id + * * @param threadPoolId threadPoolId * @return ThreadPoolExecutor */