-
Notifications
You must be signed in to change notification settings - Fork 205
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ApplicationInsights-Java having issues with Tomcat Shutdown. #712
Comments
@sudhanshu20 could you please provide the way you are instrumenting your application. Also what kind of application are you having. Could you please provide details. Also please turn on SDK logs and provide us with those also. |
@dhaval24 Its REST based api using Spring MVC and we are instrumenting the application using ApplicationInsights.xml instrumentationkey. The logging to the portal has no issues and we can access the logs via portal. The problem is with Tomcat Shutdown/Restart after the introduction of the app insights filter. What specific logs are you looking from the application? |
@sudhanshu20 I am looking for the Application Insights SDK logs to see if the SDK is behaving wierdly. You can turn SDK logs on by |
@dhaval24 Please find attached startup and shutdown log with AI SDK logs turned on. I have removed some app specific information from the logs. It seems the AI beat is still active while shutdown and tomcat is not able to kill it? Please let me know in case you need more info. |
@sudhanshu20 , There is a Here's an article with more general information about the spring-boot annotation: https://www.baeldung.com/spring-servletcomponentscan Let us know if this is a sufficient workaround. We're investigating ways for this to be picked up without additional configuration. For our reference, is this packaged as a WAR or JAR? |
@littleaj , @dhaval24 . Thanks for looking into the issue. The workaround worked!. I added the following listener in web.xml of the app and now server shutdown is smooth. FYI, it now prints the shutdown comment 'Shutting down thread pools' as well. < listener > |
Expected behavior
All open threads by ApplicationInsights close gracefully while Tomcat shuts down.
Actual behavior
Tomcat 8.5 shutdown gets stuck while probably closing threads started by appinsights filter. This creates issues with Jenkins application auto build and deploy.
Removing the filter lets tomcat shutdown gracefully.
Attached shutdown log of tomcat which get stuck and does not respond.
appinsights_issue.txt
The text was updated successfully, but these errors were encountered: