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

Handles leakage on Windows #11026

Closed
a-zagaevskiy opened this issue Aug 10, 2021 · 2 comments · Fixed by #11143
Closed

Handles leakage on Windows #11026

a-zagaevskiy opened this issue Aug 10, 2021 · 2 comments · Fixed by #11143
Assignees
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/dependencies Pull requests that update a dependency file theme/platform-windows theme/plugin type/bug
Milestone

Comments

@a-zagaevskiy
Copy link
Contributor

Nomad version

Nomad v0.10.5

Operating system and Environment details

Windows 10

Issue

There is a leakage of process handlers on Windows. The source of leakage is somewhere in the agent process and connected with monitoring of task's logs. After few days of working there were over 2 million opened handlers detected with Process Explorer utility.

Reproduction steps

Create a simple raw-exec task with activated monitoring of logs and keep it working few days. If you kill "nomad logmon" child processes purposely, the leakage in the agent stops.

Moreover, we've already found a bug within go-plugin, which causes this leakage:
https://github.com/hashicorp/go-plugin/blob/master/process_windows.go#L18-L28
Adding a deferred call of syscall.CloseHandle(h) fixes the issue.

@notnoop
Copy link
Contributor

notnoop commented Aug 10, 2021

Wow! Thanks for finding and pointing out the cause of the bug! I'll follow up with go-plugin to ensure the handles get closed, and do some testing to see if there are any other leaks. Thank you so much for reaching out!

@notnoop notnoop self-assigned this Aug 10, 2021
@a-zagaevskiy a-zagaevskiy changed the title Handlers leakage on Windows Handles leakage on Windows Aug 10, 2021
@jrasell jrasell added stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/platform-windows theme/plugin theme/dependencies Pull requests that update a dependency file labels Aug 11, 2021
@jrasell jrasell added this to the 1.1.5 milestone Sep 7, 2021
@github-actions
Copy link

I'm going to lock this issue because it has been closed for 120 days ⏳. This helps our maintainers find and focus on the active issues.
If you have found a problem that seems similar to this, please open a new issue and complete the issue template so we can capture all the details necessary to investigate further.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Oct 16, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
stage/accepted Confirmed, and intend to work on. No timeline committment though. theme/dependencies Pull requests that update a dependency file theme/platform-windows theme/plugin type/bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants