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?