I am trying to fix an issue we are running into with cloudenvy, which uses fabric for remote ssh command execution with ssh-agent forwarding. In one of our projects, we execute a remote shell script which calls a ruby script, which then invokes quite a few git commands (hundreds). We experienced an issue with OS X clients getting "OSError: too many open files" and traced it to pipes and ssh-agent sockets on the client side- about 800 total.
After digging through the fabric and paramiko codebase today, I think I narrowed it down to something discussed in:
It doesn't appear to close pipes when we receive EOFs on our ssh-agent channels. I read that you were planning on handling EOFs on a per-channel basis but may not have had the time to address it, and opted for clean up at the end of execute. Is this still the case? Do you have suggestions for a work around?
Thanks in advance!
It looks like the read/write pipes are left in the select loop in AgentProxyThread after we receive an EOF. Proposed a fix to paramiko. My code is working as expected with a reasonable open file count.
Yup this looks like it's all Paramiko, so I'll close this here. Thanks!