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

The win_perf_counters input does not close query handles #2843

Closed
danielnelson opened this issue May 22, 2017 · 2 comments
Closed

The win_perf_counters input does not close query handles #2843

danielnelson opened this issue May 22, 2017 · 2 comments
Labels
area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) platform/windows

Comments

@danielnelson
Copy link
Contributor

Bug report

Based on code inspection, the win_perf_counters input does not close its handle using PdhCloseQuery. This will likely cause the handles to become lost if the Telegraf reloads the plugin.

Relevant telegraf.conf:

N/A

System info:

N/A

Steps to reproduce:

May not currently be possible since I don't think you can trigger a reload of plugins in Windows.

Expected behavior:

win_perf_counters should call PdhCloseQuery for every handle opened with PdhOpenQuery.

Actual behavior:

PdhCloseQuery is never called

Additional info:

Has not been verified. Discovered in code review of #2800

@danielnelson danielnelson added area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) platform/windows labels May 22, 2017
@danielnelson
Copy link
Contributor Author

@vlastahajek Can you take a look at this and let me know if we need to address?

@vlastahajek
Copy link
Contributor

@danielnelson This is handled in #4189.
I created reusable struct representing query, which closes previous query, during each open. Even it may not seems perfect from OOD perspective, I did it so to create simple GO mock-able abstraction with the least possible amount of business logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/windows Related to windows plugins (win_eventlog, win_perf_counters, win_services) platform/windows
Projects
None yet
Development

No branches or pull requests

2 participants