This is an automated email from the ASF dual-hosted git repository.
markt pushed a commit to branch 10.0.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.0.x by this push:
new 9317827f7a Remove meaningless code
9317827f7a is described below
commit 9317827f7acaead4b203183c31526da331288f92
Author: lihan <[email protected]>
AuthorDate: Sun May 8 19:32:59 2022 +0800
Remove meaningless code
---
.../org/apache/catalina/core/StandardThreadExecutor.java | 16 ----------------
java/org/apache/catalina/core/mbeans-descriptors.xml | 4 ----
webapps/docs/changelog.xml | 6 ++++++
webapps/docs/config/executor.xml | 4 ----
4 files changed, 6 insertions(+), 24 deletions(-)
diff --git a/java/org/apache/catalina/core/StandardThreadExecutor.java
b/java/org/apache/catalina/core/StandardThreadExecutor.java
index 2f8aaf4d2c..6e18c61852 100644
--- a/java/org/apache/catalina/core/StandardThreadExecutor.java
+++ b/java/org/apache/catalina/core/StandardThreadExecutor.java
@@ -74,11 +74,6 @@ public class StandardThreadExecutor extends
LifecycleMBeanBase
*/
protected String name;
- /**
- * prestart threads?
- */
- protected boolean prestartminSpareThreads = false;
-
/**
* The maximum number of elements that can queue up before we reject them
*/
@@ -121,9 +116,6 @@ public class StandardThreadExecutor extends
LifecycleMBeanBase
TaskThreadFactory tf = new
TaskThreadFactory(namePrefix,daemon,getThreadPriority());
executor = new ThreadPoolExecutor(getMinSpareThreads(),
getMaxThreads(), maxIdleTime, TimeUnit.MILLISECONDS,taskqueue, tf);
executor.setThreadRenewalDelay(threadRenewalDelay);
- if (prestartminSpareThreads) {
- executor.prestartAllCoreThreads();
- }
taskqueue.setParent(executor);
setState(LifecycleState.STARTING);
@@ -214,10 +206,6 @@ public class StandardThreadExecutor extends
LifecycleMBeanBase
return name;
}
- public boolean isPrestartminSpareThreads() {
-
- return prestartminSpareThreads;
- }
public void setThreadPriority(int threadPriority) {
this.threadPriority = threadPriority;
}
@@ -251,10 +239,6 @@ public class StandardThreadExecutor extends
LifecycleMBeanBase
}
}
- public void setPrestartminSpareThreads(boolean prestartminSpareThreads) {
- this.prestartminSpareThreads = prestartminSpareThreads;
- }
-
public void setName(String name) {
this.name = name;
}
diff --git a/java/org/apache/catalina/core/mbeans-descriptors.xml
b/java/org/apache/catalina/core/mbeans-descriptors.xml
index a04ccbe4af..6fa6a85a02 100644
--- a/java/org/apache/catalina/core/mbeans-descriptors.xml
+++ b/java/org/apache/catalina/core/mbeans-descriptors.xml
@@ -1524,10 +1524,6 @@
type="int"
writeable="false" />
- <attribute name="prestartminSpareThreads"
- description="Prestart threads?"
- is="true"
- type="boolean"/>
<attribute name="queueSize"
description="Number of tasks waiting to be processed"
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index 39b0683694..df8f423ed8 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -163,6 +163,12 @@
the internal, in memory key store. Based on <pr>511</pr>.
(jfclere/markt)
</add>
+ <fix>
+ Remove the <code>prestartminSpareThreads</code> attribute of the
+ <code>StandardThreadExecutor</code> since all core threads are always
+ started by default making this attribute meaningless. Pull request
+ <pr>510</pr> provided by Aooohan. (markt)
+ </fix>
</changelog>
</subsection>
<subsection name="Jasper">
diff --git a/webapps/docs/config/executor.xml b/webapps/docs/config/executor.xml
index b896a91587..05b1420b8e 100644
--- a/webapps/docs/config/executor.xml
+++ b/webapps/docs/config/executor.xml
@@ -107,10 +107,6 @@
<p>(int) The maximum number of runnable tasks that can queue up awaiting
execution before we reject them. Default value is
<code>Integer.MAX_VALUE</code></p>
</attribute>
- <attribute name="prestartminSpareThreads" required="false">
- <p>(boolean) Whether minSpareThreads should be started when starting the
Executor or not,
- the default is <code>false</code></p>
- </attribute>
<attribute name="threadRenewalDelay" required="false">
<p>(long) If a <a
href="listeners.html">ThreadLocalLeakPreventionListener</a> is configured,
it will notify this executor about stopped contexts.
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]