clintropolis opened a new pull request #12056:
URL: https://github.com/apache/druid/pull/12056


   After updating in log4j2 in #12051, errors when shutting down services and 
tasks appear of the form
   
   ```
   
org.apache.druid.initialization.Log4jShutterDownerModule$Log4jShutterDowner.stop()]
 on 
object[org.apache.druid.initialization.Log4jShutterDownerModule$Log4jShutterDowner@ad5cffa]
   java.lang.reflect.InvocationTargetException: null
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) 
~[?:1.8.0_292]
        at 
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62) 
~[?:1.8.0_292]
        at 
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
 ~[?:1.8.0_292]
        at java.lang.reflect.Method.invoke(Method.java:498) ~[?:1.8.0_292]
        at 
org.apache.druid.java.util.common.lifecycle.Lifecycle$AnnotationBasedHandler.stop(Lifecycle.java:465)
 [druid-core-0.22.1.jar:0.22.1]
        at 
org.apache.druid.java.util.common.lifecycle.Lifecycle.stop(Lifecycle.java:368) 
[druid-core-0.22.1.jar:0.22.1]
        at org.apache.druid.cli.CliPeon.run(CliPeon.java:323) 
[druid-services-0.22.1.jar:0.22.1]
        at org.apache.druid.cli.Main.main(Main.java:113) 
[druid-services-0.22.1.jar:0.22.1]
   Caused by: org.apache.druid.java.util.common.ISE: Expected state [STARTED] 
found [INITIALIZED]
        at 
org.apache.druid.common.config.Log4jShutdown.stop(Log4jShutdown.java:105) 
~[druid-core-0.22.1.jar:0.22.1]
        at 
org.apache.druid.initialization.Log4jShutterDownerModule$Log4jShutterDowner.stop(Log4jShutterDownerModule.java:116)
 ~[druid-server-0.22.1.jar:0.22.1]
        ... 8 more
   ```
   
   and shutdown hooks are not run.
   
   This is because by default `log4j2.is.webapp` is set to `true` if it detects 
`javax.servlet.Servlet` or `jakarta.servlet.Servlet` on the classpath, and 
shutdown hooks are disabled for web-apps in 
https://github.com/apache/logging-log4j2/commit/b59819e47c06d9e928df7e90bdb75189fd9ce306
   
   This PR makes shutdown hooks work again by automatically setting this to 
false if it is not explicitly set in system properties (similar to the shutdown 
hook properties themselves). I don't think this should have any impact on Druid 
since we are not technically a web app, and this setting only appears to be 
used by a few jmx related settings.


-- 
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]

Reply via email to