-
Notifications
You must be signed in to change notification settings - Fork 141
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
Many ssh <defunct> then using library. #139
Comments
Hi @neodiz! I keep you updated! |
Hi @neodiz! I have realized that when I executed the ansible-playbook it also left some SSH zombie processes, and that allowed me to explore new avenues. Please, can you provide me with the following information?
Thank you very much! |
Hi. Yes i use code on docker container.
About parameter i check. A very interesting situation. I recommend adding a
mention of this issue in the documentation. I work as a devops and custom
module developer and other developers will not be able to understand what
the problem is. This may affect your library's reputation even though it is
very good.
вт, 19 мар. 2024 г. в 10:06, apenella ***@***.***>:
… Hi @neodiz <https://github.com/neodiz>!
I could reproduce what you experienced, which allowed me to work on a
solution to that issue. Unfortunately, I don't have a fix for that yet.
My first thought was that the go-ansible code did not manage properly the
processes spawned by the process started by the library. I tried to set up
the SysProcAttr <https://pkg.go.dev/syscall#SysProcAttr> or create a
process group to handle the child processes but any of those was a
deterministic solution.
I have realized that when I executed the ansible-playbook it also left
some SSH zombie processes, and that allowed me to explore new avenues.
The cause of my problem was that I executed the playbook inside a
container without the init enabled (read here
<ansible/ansible#49270>), so no one reaped
zombie processes.
Please, can you provide me with the following information?
- Are you running Ansible within a container?
- As is said here
<https://groups.google.com/g/ansible-project/c/IQoTNwDBIiA/m/qiHUTgg31lkJ>,
Ansible sets the SSH -tt parameter and that could leave zombie process
on your system, coming from the pseudo-tty. That parameter should be
overwritten by adding the -T on the SSH extra arguments. Can you
confirm if you still have zombie processes after setting the -T
parameter?
Thank you very much!
—
Reply to this email directly, view it on GitHub
<#139 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ABRLCKT6ZSEJB2HPBMFYYXLYY7PYDAVCNFSM6AAAAABEABCTS2VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDAMBWGAZDENRWG4>
.
You are receiving this because you were mentioned.Message ID:
***@***.***>
|
Hi @neodiz! Thank you very much! |
Available in v2.0.0-rc-3 |
Good afternoon. I think I found a problem in the library, a large number of child processes are not closed. Here is my example
`func ansible() error {
fmt.Println("test")
ansiblePlaybookConnectionOptions := &options.AnsibleConnectionOptions{
User: "inurmuhametov",
SSHExtraArgs: "-o ControlPersist=360s",
SCPExtraArgs: "-o ControlPersist=360s",
SFTPExtraArgs: "-o ControlPersist=360s",
}
}
func main() {
}`
`
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
root 1 0.0 0.0 1229188 6164 pts/0 Ssl+ 12:13 0:00 /app
root 17 0.0 0.0 0 0 ? Zs 12:13 0:00 [ssh]
root 18 0.0 0.0 0 0 ? Zs 12:13 0:00 [ssh]
root 64 0.0 0.0 7636 4192 pts/1 Ss 12:14 0:00 bash
root 102 0.0 0.0 0 0 ? Zs 12:18 0:00 [ssh]
root 103 0.0 0.0 0 0 ? Zs 12:18 0:00 [ssh]
root 393 0.0 0.0 0 0 ? Zs 12:23 0:00 [ssh]
root 394 0.0 0.0 0 0 ? Zs 12:23 0:00 [ssh]
root 437 0.0 0.0 0 0 ? Zs 12:29 0:00 [ssh]
root 438 0.0 0.0 0 0 ? Zs 12:29 0:00 [ssh]
root 481 0.0 0.0 0 0 ? Zs 12:34 0:00 [ssh]
root 482 0.0 0.0 0 0 ? Zs 12:34 0:00 [ssh]
root 525 0.0 0.0 0 0 ? Zs 12:39 0:00 [ssh]
root 526 0.0 0.0 0 0 ? Zs 12:39 0:00 [ssh]
root 569 0.0 0.0 0 0 ? Zs 12:44 0:00 [ssh]
root 570 0.0 0.0 0 0 ? Zs 12:44 0:00 [ssh]
root 613 0.0 0.0 0 0 ? Zs 12:49 0:00 [ssh]
root 614 0.0 0.0 0 0 ? Zs 12:49 0:00 [ssh]
root 657 0.0 0.0 0 0 ? Zs 12:54 0:00 [ssh]
root 658 0.0 0.0 0 0 ? Zs 12:54 0:00 [ssh]
root 701 0.0 0.0 0 0 ? Zs 12:59 0:00 [ssh]
root 702 0.0 0.0 0 0 ? Zs 12:59 0:00 [ssh]
root 745 0.0 0.0 0 0 ? Zs 13:05 0:00 [ssh]
root 746 0.0 0.0 0 0 ? Zs 13:05 0:00 [ssh]
root 789 0.0 0.0 0 0 ? Zs 13:10 0:00 [ssh]
root 790 0.0 0.0 0 0 ? Zs 13:10 0:00 [ssh]
root 833 0.0 0.0 0 0 ? Zs 13:15 0:00 [ssh]
root 834 0.0 0.0 0 0 ? Zs 13:15 0:00 [ssh]
root 877 0.0 0.0 0 0 ? Zs 13:20 0:00 [ssh]
root 878 0.0 0.0 0 0 ? Zs 13:20 0:00 [ssh]
root 921 0.0 0.0 0 0 ? Zs 13:25 0:00 [ssh]
root 922 0.0 0.0 0 0 ? Zs 13:25 0:00 [ssh]
root 965 0.0 0.0 0 0 ? Zs 13:30 0:00 [ssh]
root 966 0.0 0.0 0 0 ? Zs 13:30 0:00 [ssh]
root 1009 0.0 0.0 0 0 ? Zs 13:35 0:00 [ssh]
root 1010 0.0 0.0 0 0 ? Zs 13:35 0:00 [ssh]
root 1053 0.0 0.0 0 0 ? Zs 13:41 0:00 [ssh]
root 1054 0.0 0.0 0 0 ? Zs 13:41 0:00 [ssh]
root 1097 0.0 0.0 0 0 ? Zs 13:46 0:00 [ssh]
root 1098 0.0 0.0 0 0 ? Zs 13:46 0:00 [ssh]
root 1141 0.0 0.0 0 0 ? Zs 13:51 0:00 [ssh]
root 1142 0.0 0.0 0 0 ? Zs 13:51 0:00 [ssh]
root 1185 0.0 0.0 0 0 ? Zs 13:56 0:00 [ssh]
root 1186 0.0 0.0 0 0 ? Zs 13:56 0:00 [ssh]
root 1229 0.0 0.0 0 0 ? Zs 14:01 0:00 [ssh]
root 1230 0.0 0.0 0 0 ? Zs 14:01 0:00 [ssh]
root 1273 0.0 0.0 0 0 ? Zs 14:06 0:00 [ssh]
root 1274 0.0 0.0 0 0 ? Zs 14:06 0:00 [ssh]
root 1317 0.0 0.0 0 0 ? Zs 14:11 0:00 [ssh]
root 1318 0.0 0.0 0 0 ? Zs 14:11 0:00 [ssh]
root 1361 0.0 0.0 0 0 ? Zs 14:16 0:00 [ssh]
root 1362 0.1 0.0 0 0 ? Zs 14:16 0:00 [ssh]
`
The text was updated successfully, but these errors were encountered: