Skip to content
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

Sentry won't stop threads during web app stop when used with Tomcat 9 #2074

Closed
wukrwurk opened this issue Jun 1, 2022 · 6 comments
Closed

Comments

@wukrwurk
Copy link

wukrwurk commented Jun 1, 2022

Integration

sentry-spring-boot-starter

Java Version

11

Version

5.7.3

Steps to Reproduce

  1. Define a spring boot project, add sentry client to pom.xml
  2. Start a tomcat 9 with a war file deployed
  3. Redeploy(replace) a war file (without restarting tomcat)

The issue is similar to #487 or #420

Expected Result

Sentry should stop threads once web app is stopped

Actual Result

org.apache.catalina.loader.WebappClassLoaderBase.checkThreadLocalMapForLeaks The web application [ftadmin] created a ThreadLocal with key of type [io.sentry.environment.SentryEnvironment$1] (value [io.sentry.environment.SentryEnvironment$1@26c761df]) and a value of type [java.util.concurrent.atomic.AtomicInteger] (value [0]) but failed to remove it when the web application was stopped. Threads are going to be renewed over time to try and avoid a probable memory leak.

@adinauer
Copy link
Member

adinauer commented Jun 3, 2022

Hello @wukrwurk thank you for reporting this.

Your warning message indicates an old version of Sentry. Did you try multiple versions and paste the message from a run with the old version?

I've created #2079

@adinauer
Copy link
Member

adinauer commented Jun 3, 2022

Is the warning the only problem you're facing or is there more to it?

@marandaneto
Copy link
Contributor

@wukrwurk any news here?

@wukrwurk
Copy link
Author

wukrwurk commented Jun 18, 2022

@marandaneto @adinauer sorry for a delayed response guys and thanks for looking into this.

I have tried 5.7.3 and 5.7.4 versions. The issues is not only in the warning message but the fact that web apps consume a lot of memory. So much that we had to disable it in all our apps that are served with tomcat9.

@adinauer
Copy link
Member

@wukrwurk thanks for the info, we'll look into this but can't say yet if we'll be able to fix this quickly or if it would require bigger changes to how the SDK works. We'll update this issue once we know more.

@adinauer
Copy link
Member

We'll try to reduce the pain of this by implementing #2079

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Archived in project
Development

No branches or pull requests

3 participants