wilkinsona commented on a change in pull request #456:
URL: https://github.com/apache/tomcat/pull/456#discussion_r739128184
##########
File path: java/org/apache/catalina/core/AprLifecycleListener.java
##########
@@ -38,6 +38,13 @@
/**
* Implementation of <code>LifecycleListener</code> that will init and
* and destroy APR.
+ * <p>
+ * <strong>Note</strong>: This listener must only be used within a {@code
Server}
+ * element to manage APR/OpenSSL init and destroy JVM-wide. If you are running
+ * Tomcat in an embedded fashion and have more than one Tomcat instance per
JVM,
+ * this listener <em>must not</em> be added to the {@code Server} instance, but
Review comment:
Maybe this is too subtle for Tomcat's javadoc, but this isn't strictly
true. You can safely add the listener to a `Server` (or even a `Context` if you
know there will only be one) as long as that `Server` is started first and
stopped last. In the absence of an API that's designed to manage the lifecycle
of APR outside of Tomcat's `Lifecycle` and `LifecycleEvent`, I suspect that's
what we'll do in Spring Boot if the Tomcat team decides not to make
`AprLifecycleListener` more robust.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]