-
Notifications
You must be signed in to change notification settings - Fork 167
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
win_powershell: assigning result from Get-Content to $Ansible.Result results in memory leak #360
Comments
Thanks for the bug report, the trouble here is that I see 2 options available here:
The first will be the simplest but people could be expecting the ETS members to be present whereas the second option acts more like In the meantime as a workaround I recommend you change the |
I ended up going for option 1 and stripping out the ETS properties for these primitive types. The PR for this is #373. |
SUMMARY-
Assigning the result from
Get-Content
to$Ansible.Result
inwin_powershell
results in memory leak on the target host.The task never ends, and even if cancelled on the controller node, the powershell process runs forever on the target node, resulting in total memory exhaustion.
ISSUE TYPE
COMPONENT NAME
win_powershell
ANSIBLE VERSION
COLLECTION VERSION
CONFIGURATION
OS / ENVIRONMENT
Host os: fedora 35
Target os: Windows 11 Enterprise 21H2, build 22000.675
STEPS TO REPRODUCE
EXPECTED RESULTS
Task should terminate, no memory leak should occur, and the result is correctly returned to the ansible controller
ACTUAL RESULTS
The task never terminates, and memory usage of the powershell.exe process on the target node is rising very quickly. Terminating the ansible process on the controller node does not result in the process being ended on the target node. Memory usage will rise until exhaustion:
This is after about 3-5 minutes. Running the task again results in an additional powershell.exe process also quickly ramping up to memory exhaustion.
The text was updated successfully, but these errors were encountered: