This is an automated email from the ASF dual-hosted git repository. remm pushed a commit to branch 10.1.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
The following commit(s) were added to refs/heads/10.1.x by this push: new fee52c7697 Sync ContainerBase background processes with lifecycle operations fee52c7697 is described below commit fee52c76976c51d81f8711b94c0b838d16e168e6 Author: remm <r...@apache.org> AuthorDate: Fri Nov 17 11:35:40 2023 +0100 Sync ContainerBase background processes with lifecycle operations Also sync check for webapp updates since the same lifecycle operations could cause problems. --- java/org/apache/catalina/core/ContainerBase.java | 2 +- java/org/apache/catalina/startup/HostConfig.java | 23 +++++++++++++++-------- webapps/docs/changelog.xml | 12 +++++++++++- 3 files changed, 27 insertions(+), 10 deletions(-) diff --git a/java/org/apache/catalina/core/ContainerBase.java b/java/org/apache/catalina/core/ContainerBase.java index c654b98a6d..6e4ef4b950 100644 --- a/java/org/apache/catalina/core/ContainerBase.java +++ b/java/org/apache/catalina/core/ContainerBase.java @@ -1064,7 +1064,7 @@ public abstract class ContainerBase extends LifecycleMBeanBase implements Contai * this container. Unexpected throwables will be caught and logged. */ @Override - public void backgroundProcess() { + public synchronized void backgroundProcess() { if (!getState().isAvailable()) { return; diff --git a/java/org/apache/catalina/startup/HostConfig.java b/java/org/apache/catalina/startup/HostConfig.java index 97d77a33df..0e1288668b 100644 --- a/java/org/apache/catalina/startup/HostConfig.java +++ b/java/org/apache/catalina/startup/HostConfig.java @@ -1722,15 +1722,22 @@ public class HostConfig implements LifecycleListener { * @param name The name of the web application to check */ public void check(String name) { - if (tryAddServiced(name)) { - try { - DeployedApplication app = deployed.get(name); - if (app != null) { - checkResources(app, true); + synchronized (host) { + if (host instanceof Lifecycle) { + if (!((Lifecycle) host).getState().isAvailable()) { + return; + } + } + if (tryAddServiced(name)) { + try { + DeployedApplication app = deployed.get(name); + if (app != null) { + checkResources(app, true); + } + deployApps(name); + } finally { + removeServiced(name); } - deployApps(name); - } finally { - removeServiced(name); } } } diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 750696e541..93bf4d1104 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -104,7 +104,17 @@ They eventually become mixed with the numbered issues (i.e., numbered issues do not "pop up" wrt. others). --> -<section name="Tomcat 10.1.16 (schultz)" rtext="in development"> +<section name="Tomcat 10.1.17 (schultz)" rtext="in development"> + <subsection name="Catalina"> + <changelog> + <fix> + Background processes should not be run concurrently with lifecycle + oprations of a container. (remm) + </fix> + </changelog> + </subsection> +</section> +<section name="Tomcat 10.1.16 (schultz)" rtext="2023-11-14"> <subsection name="Catalina"> <changelog> <fix> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org