You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by ma...@apache.org on 2021/11/25 12:22:59 UTC

[tomcat] branch 8.5.x updated: Document conditions of use for AprLifecycleListener to avoid JVM crashes

This is an automated email from the ASF dual-hosted git repository.

markt pushed a commit to branch 8.5.x
in repository https://gitbox.apache.org/repos/asf/tomcat.git


The following commit(s) were added to refs/heads/8.5.x by this push:
     new 2beeaa4  Document conditions of use for AprLifecycleListener to avoid JVM crashes
2beeaa4 is described below

commit 2beeaa46c72c446327cb3fd7832bee512591b1e6
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Fri Oct 29 11:19:43 2021 +0200

    Document conditions of use for AprLifecycleListener to avoid JVM crashes
    
    This basically documents how to avoid issues like
    https://github.com/spring-projects/spring-boot/issues/28472
---
 java/org/apache/catalina/core/AprLifecycleListener.java | 6 ++++++
 webapps/docs/changelog.xml                              | 4 ++++
 2 files changed, 10 insertions(+)

diff --git a/java/org/apache/catalina/core/AprLifecycleListener.java b/java/org/apache/catalina/core/AprLifecycleListener.java
index 80dc5a5..862b513 100644
--- a/java/org/apache/catalina/core/AprLifecycleListener.java
+++ b/java/org/apache/catalina/core/AprLifecycleListener.java
@@ -41,6 +41,12 @@ import org.apache.tomcat.util.res.StringManager;
  * and destroy APR.
  * <p>
  * This listener must only be nested within {@link Server} elements.
+ * <p>
+ * <strong>Note</strong>: If you are running Tomcat in an embedded fashion and
+ * have more than one Server instance per JVM, this listener <em>must not</em>
+ * be added to the {@code Server} instances, but handled outside by the calling
+ * code which is bootstrapping the embedded Tomcat instances. Not doing so will
+ * lead to JVM crashes.
  *
  * @since 4.1
  */
diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml
index bcf9695..7ea5915 100644
--- a/webapps/docs/changelog.xml
+++ b/webapps/docs/changelog.xml
@@ -115,6 +115,10 @@
         <bug>65684</bug>: Fix a potential <code>NullPointerException</code> when
         using JULI. (markt)
       </fix>
+      <docs>
+        Document conditions under which the <code>AprLifecycleListener</code>
+        can be used to avoid JVM crashes. (michaelo)
+      </docs>
     </changelog>
   </subsection>
   <subsection name="Coyote">

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@tomcat.apache.org
For additional commands, e-mail: dev-help@tomcat.apache.org