-
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: Executing Register-ScheduledJob results in memory leak & high cpu usage when job already exists #375
Comments
I'm a bit confused. Sometimes the leak occurs on first execution (no task with the same name exists), sometimes it only occurs on the second execution (task with the same name exists) |
This is most likely related to #360. The output of |
Looks like the problem was something else. When a scheduled job already existed an error record is generated and the job definition is part of the error records |
SUMMARY
Running
Register-ScheduledJob
with an already existing-Name
in awin_powershell
task results in memory leak and high cpu usage on the target hosts.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 Server 2022
STEPS TO REPRODUCE
Run this playbook twice. On the second run, the memory leak & cpu usage occurs.
Using
-FilePath
instead of-ScriptBlock
has the same result.EXPECTED RESULTS
Task should terminate with an error (as it does when executing the command without ansible), no memory leak should occur, and the task should be registered.
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 one minute)
The text was updated successfully, but these errors were encountered: