0

I have created a Java application and have an endpoint that waits for 25 seconds before returning a response. I have protected my application with the graceful shutdown mechanism as follows and works perfectly fine on my IntelliJ IDEA

server.shutdown=graceful
spring.lifecycle.timeout-per-shutdown-phase=1m

But when I deploy my application on local tomcat 8 and shutdown after calling the endpoint it gives below error and am not sure what I am doing wrong here.

Error:
10-Aug-2022 16:29:31.578 WARNING [localhost-startStop-1] org.apache.catalina.loader.WebappClassLoaderBase.clearReferencesThreads The web application [ROOT] is still processing a request that has yet to finish. This is very likely to create a memory leak. You can control the time allowed for requests to finish by using the unloadDelay attribute of the standard Context implementation. Stack trace of request processing thread:[
Shutdown Script:
kill -15 $(ps -ef | grep tomcat | awk '{print $2}')

Can someone please help me on this?

  • The `server.shutdown` (or rather all `server.*` aren't applicable when deploying to a managed server. You need to configure your server accordingly yourself. – M. Deinum Aug 11 '22 at 04:58
  • Okay. Can you please tell me hoe to configure it manually? I checked online but none of the resources were helpful. Thanks – Dishant Patel Aug 11 '22 at 16:38
  • I would suggest checking the Spring Boot source on what that does when `server.shutdown` is set to `graceful` and try to rework that back into a server configuration. – M. Deinum Aug 12 '22 at 06:21
  • I tried to see but cannot find anything useful; can you guide me what should I try? – Dishant Patel Aug 16 '22 at 22:43

0 Answers0