obsidiandynamics / kafdrop

Kafka Web UI
Apache License 2.0
5.56k stars 841 forks source link

Error during shutdown #496

Closed davideicardi closed 1 year ago

davideicardi commented 1 year ago

After upgrading SpringBoot and JDK (#482), there is an error during shutdown:

2023-03-27 18:38:59.908  INFO 82457 [           main] k.s.BuildInfo                            : Kafdrop version: 4.0.0-SNAPSHOT, build time: 2023-03-27T16:38:57.091Z
2023-03-27 18:39:00.529  INFO 82457 [           main] o.s.b.a.e.w.EndpointLinksResolver        : Exposing 13 endpoint(s) beneath base path '/actuator'
2023-03-27 18:39:00.573  INFO 82457 [           main] i.u.Undertow                             : starting server: Undertow - 2.3.4.Final
2023-03-27 18:39:00.577  INFO 82457 [           main] o.x.Xnio                                 : XNIO version 3.8.8.Final
2023-03-27 18:39:00.582  INFO 82457 [           main] o.x.n.NioXnio                            : XNIO NIO Implementation Version 3.8.8.Final
2023-03-27 18:39:00.594  INFO 82457 [           main] o.j.t.Version                            : JBoss Threads version 3.5.0.Final
2023-03-27 18:39:00.614  INFO 82457 [           main] o.s.b.w.e.u.UndertowWebServer            : Undertow started on port(s) 9000 (http)
2023-03-27 18:39:00.624  INFO 82457 [           main] o.s.b.StartupInfoLogger                  : Started Kafdrop in 2.094 seconds (process running for 2.445)
2023-03-27 18:41:20.915  INFO 82457 [ionShutdownHook] i.u.Undertow                             : stopping server: Undertow - 2.3.4.Final
Exception in thread "SpringApplicationShutdownHook" java.lang.IllegalStateException: UT015023: This Context has been already destroyed
    at io.undertow.servlet.spec.ServletContextImpl.getDeploymentInfo(ServletContextImpl.java:210)
    at io.undertow.servlet.spec.ServletContextImpl.getInitParameterNames(ServletContextImpl.java:434)
    at org.springframework.web.context.support.ServletContextPropertySource.getPropertyNames(ServletContextPropertySource.java:41)
    at org.springframework.core.env.EnumerablePropertySource.containsProperty(EnumerablePropertySource.java:74)
    at org.springframework.core.env.PropertySourcesPropertyResolver.containsProperty(PropertySourcesPropertyResolver.java:51)
    at org.springframework.boot.context.properties.source.ConfigurationPropertySourcesPropertyResolver.containsProperty(ConfigurationPropertySourcesPropertyResolver.java:55)
    at org.springframework.core.env.AbstractEnvironment.containsProperty(AbstractEnvironment.java:546)
    at org.springframework.boot.logging.log4j2.SpringEnvironmentPropertySource.containsProperty(SpringEnvironmentPropertySource.java:55)
    at org.apache.logging.log4j.util.PropertiesUtil$Environment.get(PropertiesUtil.java:537)
    at org.apache.logging.log4j.util.PropertiesUtil$Environment.access$200(PropertiesUtil.java:444)
    at org.apache.logging.log4j.util.PropertiesUtil.getStringProperty(PropertiesUtil.java:392)
    at org.apache.logging.log4j.util.PropertiesUtil.getBooleanProperty(PropertiesUtil.java:179)
    at org.apache.logging.log4j.status.StatusLogger.isDebugPropertyEnabled(StatusLogger.java:143)
    at org.apache.logging.log4j.status.StatusLogger.isEnabled(StatusLogger.java:426)
    at org.apache.logging.log4j.status.StatusLogger.isEnabled(StatusLogger.java:348)
    at org.apache.logging.log4j.spi.AbstractLogger.logIfEnabled(AbstractLogger.java:1906)
    at org.apache.logging.log4j.spi.AbstractLogger.debug(AbstractLogger.java:458)
    at org.apache.logging.log4j.core.LoggerContext.stop(LoggerContext.java:355)
    at org.apache.logging.log4j.core.AbstractLifeCycle.stop(AbstractLifeCycle.java:136)
    at org.springframework.boot.logging.log4j2.Log4J2LoggingSystem.lambda$getShutdownHandler$2(Log4J2LoggingSystem.java:446)
    at java.base/java.lang.Iterable.forEach(Iterable.java:75)
    at org.springframework.boot.SpringApplicationShutdownHook.run(SpringApplicationShutdownHook.java:110)
    at java.base/java.lang.Thread.run(Thread.java:833)

The error is probably related to https://github.com/spring-projects/spring-boot/issues/33450 issue.

The above issue can be avoided using the following Springboot configuration:

spring.main.register-shutdown-hook: false

See also https://github.com/obsidiandynamics/kafdrop/pull/482#discussion_r1149567462

cc @mehdihasan @Bert-R

mehdihasan commented 1 year ago

Will keep an eye on this.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

Bert-R commented 1 year ago

There is some movement on the related Spring Boot issue, so let's not close this yet.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.

github-actions[bot] commented 1 year ago

This issue is stale because it has been open for 30 days with no activity.

github-actions[bot] commented 1 year ago

This issue was closed because it has been inactive for 14 days since being marked as stale.