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

fix: release StatsDSender executor #115

Merged
merged 1 commit into from
Jun 18, 2020

Conversation

hanny24
Copy link
Contributor

@hanny24 hanny24 commented Jun 16, 2020

This PR fixes resource leak caused by ad47973. There is an executor in StatsDSender that was never been shutdown.

Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you very much for this fix, really appreciated! 🙇

It looks pretty much good to go, just having a thought about whether or not this should be a daemon thread.

@Override public Thread newThread(final Runnable runnable) {
final Thread result = delegate.newThread(runnable);
result.setName("StatsD-Sender-" + result.getName());
result.setDaemon(true);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm kind of torn about making this a daemon thread or not. On one hand this is an IO intensive thread, and we might also want to make sure it shuts down in orderly fashion, on the other hand this runs next to the application and one could argue shouldn't really be a user thread....

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't have a strong option about it as well. But I thought it might be a good idea to make it a daemon since com.timgroup.statsd.NonBlockingStatsDClient is also creating daemon threads.

Copy link
Member

@truthbk truthbk left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's merge this as-is! Thank you very much @hanny24 🙇

@truthbk truthbk merged commit 853112e into DataDog:master Jun 18, 2020
@hanny24 hanny24 deleted the statsd-sender-shutdown branch June 18, 2020 14:25
@prudhvi
Copy link

prudhvi commented Jun 26, 2020

@truthbk Are you planning to do a new release some time soon?, thanks.

@truthbk
Copy link
Member

truthbk commented Jun 26, 2020

@prudhvi early next week!

dbyron0 pushed a commit to locationlabs/java-dogstatsd-client that referenced this pull request Jan 11, 2021
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

Successfully merging this pull request may close these issues.

3 participants