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

Thread pools in StatsDNonBlockingProcessor not properly closed #116

Closed
domisum opened this issue Jul 13, 2020 · 2 comments
Closed

Thread pools in StatsDNonBlockingProcessor not properly closed #116

domisum opened this issue Jul 13, 2020 · 2 comments

Comments

@domisum
Copy link

domisum commented Jul 13, 2020

My application using this library doesn't properly shut down. I already updated to the latest version 2.10.2 which fixed another thread pool issue (PR #115 ) , but this one seems to be still wrong.

Thread[pool-3-thread-1,5,main], id: 19, daemon: false
    java.base@11.0.7/java.lang.Thread.sleep(Native Method)
    app//com.timgroup.statsd.StatsDNonBlockingProcessor$ProcessingTask.run(StatsDNonBlockingProcessor.java:35)
    java.base@11.0.7/java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:515)
    java.base@11.0.7/java.util.concurrent.FutureTask.run(FutureTask.java:264)
    java.base@11.0.7/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1128)
    java.base@11.0.7/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:628)
    java.base@11.0.7/java.lang.Thread.run(Thread.java:834)
@blevz
Copy link
Contributor

blevz commented Jul 14, 2020

I ran into a similar issue when upgrading my dogstatsd client. I believe the issue is the StatsDNonBlockingProcessor executor is using non daemon threads. Additionally, if you opt into using telemetry, the TimerTask it spawns is non daemon and will similarly hang the JVM at shutdown. I have a pull request open with the changes which should fix both of these issues:
#117

@domisum domisum changed the title Threads pools in StatsDNonBlockingProcessor not properly closed Thread pools in StatsDNonBlockingProcessor not properly closed Jul 14, 2020
@domisum
Copy link
Author

domisum commented Jul 20, 2020

Fixed in PR #117

@domisum domisum closed this as completed Jul 20, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants