Handles leakage on Windows #11026
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
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.The text was updated successfully, but these errors were encountered: