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

How do I check whether Client has been closed? #140

Open
jrefior opened this issue Mar 25, 2020 · 2 comments
Open

How do I check whether Client has been closed? #140

jrefior opened this issue Mar 25, 2020 · 2 comments

Comments

@jrefior
Copy link

jrefior commented Mar 25, 2020

It appears to be necessary to call Close() on statsd Clients to clean up cpu/memory resources.

How do I check whether a Client has been closed, so I can get a new client if needed?

@kiyor-cai-exa
Copy link

kiyor-cai-exa commented Mar 26, 2020

I'm getting the same issue. I integrated to a custom logger and use a huge amount of events with a lot of different logger instances. The MEM resource is not able to release. But the same logic with Write to WebSocket and file (same time) are all able to close when doing GC. it did not happen half years ago I think was about version less than v2.3.0 . I didn't use go mod before so not able to tell the detail version when it was working.

@jrefior
Copy link
Author

jrefior commented Mar 27, 2020

I implemented a wrapper type with Close() and IsClosed() bool methods and that seems to be working well so far. I had to put a blocking Flush() call on the statsd Client in the Close() method to still get all metrics.

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