You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tomcat.apache.org by GitBox <gi...@apache.org> on 2021/10/29 16:42:35 UTC

[GitHub] [tomcat] ChristopherSchultz commented on pull request #456: Document conditions under which the AprLifecycleListener can be used …

ChristopherSchultz commented on pull request #456:
URL: https://github.com/apache/tomcat/pull/456#issuecomment-954890217


   Something is wrong with the premise, here. I read through [Spring-28472](https://github.com/spring-projects/spring-boot/issues/28472) and looked at the code for `AprLifecycleListener`. `AprLifecycleListener` should not be shutting-down APR twice. In `AprLifecycleListener.lifecycleEvent`, the `Lifecycle.AFTER_DESTROY` handler uses a static lock for cross-thread synchronization and only calls `terminateAPR` if `AprStatus.isAprAvailable` returns `true`. Notably, `terminateAPR` sets `AprStatus.isAprAvailable` to `false`.
   
   I can see a theoretical threading problem because `AprStatus.isAprAvailable` and `AprStatus.setAprAvailable` are not synchronized, but the static class members being set are declared `volatile` and should require threads to reload their values appropriately.
   
   Are you sure it's the shutdown that's causing the failure?
   
   I think I'd rather fix a bug that seems to be hiding, here, rather than document what can and cannot be done (in a way that is very difficult to understand, I have to admit).


-- 
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: dev-unsubscribe@tomcat.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



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