-
Notifications
You must be signed in to change notification settings - Fork 397
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
SSM connection plugin doesnt properly close connections #494
Comments
Files identified in the description:
If these files are inaccurate, please update the |
Looking more into the issue, it seems if you run a task with a loop, only the last SSM connection is actually terminated. The rest of them are left hanging. When running with Once the task is done, there are a bunch of connections left hanging on the server even though the ansible playbook is done. |
Running |
I am experiencing a similar issue where in my case I have a large set of playbook with around 200 tasks that are being executed across several private EC2 instances. At one point my tasks start timing-out with a particularly "hot" instance. I have noticed that in the middle of the execution I have over 100 connections with status "connected" in my AWS account. I have noticed this by checking Systems Manager console. A sample of the log associated with the failing command is similar to this: |
After debugging function calls and learning how connection plugins works in ansible i was able to determine that a simple destructor was all that was missing to properly clean up the connections after they are used. |
SUMMARY
When trying to run a big playbook using the SSM connection plugin, it randomly hangs in the middle of it. Very rarely am I able to run the entire playbook without issues.
ISSUE TYPE
COMPONENT NAME
ssm connection plugin
ANSIBLE VERSION
CONFIGURATION
Ansible variables used in the playbook for configuring the SSM plugin:
OS / ENVIRONMENT
Target OS:
Amazon-Linux 2
STEPS TO REPRODUCE
I dont have exact steps to replicate this issue, it seems to happen to bigger playbooks. And happens randomly, sometimes it dies immediately, sometimes it dies in the middle or end, and very rarely does it complete without issues.
EXPECTED RESULTS
To complete the playbook without hanging.
ACTUAL RESULTS
When running in verbose mode, these are the last lines printed, i left the playbook running for 10 minutes and no change happened after which i stopped it manually:
If I SSH to the server, it seems there are a lot of connections left hanging, this is the output of
ps -e --forest -o ppid,pid,user,command
:This has been an issue for me for several releases of the ssm connection plugin.
The text was updated successfully, but these errors were encountered: