Accessing sftp branches "leaks" open file descriptors

Bug #426662 reported by jpupu on 2009-09-09
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
High
Andrew Bennetts

Bug Description

When trying to open a branch over ssh/sftp, some FIFOs are opened and never closed. This is irksome, as a user application using the API has no way to mend this, and it will lead to the "Too many open files" error.

The attached script reproduces the problem.

For what it's worth, seems that sftp leaks about 2 file descriptors per open, while bzr+ssh leaks half (e.g. <50 per 100 opens). Also the problem only manifests when there is a successful ssh connection.

Related branches

jpupu (artham) wrote :
Martin Pool (mbp) on 2009-09-09
Changed in bzr:
status: New → Confirmed
importance: Undecided → High
Andrew Bennetts (spiv) wrote :

I can reproduce this with sftp:// URLs, but not bzr:// or bzr+ssh://.

For SFTP, the issue seems to be the subprocess management: nothing causes the /usr/bin/ssh processes to be terminated after the last reference to the SFTP connection goes away, so the stdin and stderr pipes linger indefinitely for each connection (hence the 2 fds leaked per open). I have a branch that fixes this.

Changed in bzr:
assignee: nobody → Andrew Bennetts (spiv)
status: Confirmed → Fix Committed
Andrew Bennetts (spiv) on 2009-11-25
summary: - Accessing remote branches "leaks" open file descriptors
+ Accessing sftp branches "leaks" open file descriptors
Andrew Bennetts (spiv) on 2009-11-26
Changed in bzr:
status: Fix Committed → Fix Released
John A Meinel (jameinel) on 2009-12-14
Changed in bzr:
milestone: none → 2.1.0b4
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers