Merge lp:~cjwatson/txpkgupload/fix-leak into lp:~lazr-developers/txpkgupload/trunk
Proposed by
Colin Watson
Status: | Merged |
---|---|
Approved by: | Colin Watson |
Approved revision: | 21 |
Merged at revision: | 21 |
Proposed branch: | lp:~cjwatson/txpkgupload/fix-leak |
Merge into: | lp:~lazr-developers/txpkgupload/trunk |
Diff against target: |
94 lines (+22/-16) 2 files modified
src/txpkgupload/plugin.py (+5/-1) src/txpkgupload/twistedsftp.py (+17/-15) |
To merge this branch: | bzr merge lp:~cjwatson/txpkgupload/fix-leak |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
William Grant | code | Approve | |
Review via email: mp+247276@code.launchpad.net |
Commit message
Fix memory leak when closing SFTP connections.
Description of the change
Yesterday evening there was an outage due to txpkgupload having leaked to the point where it was using rather more than 4GB of memory. I looked into this a bit today and found that I could make it leak just by repeatedly initiating SFTP connections. This is happening because it registers a global handler for SFTPClosed on every connection and never unregisters it. Rather than going through the component registry for this, it seems easier to just subclass FileTransferServer, and with this change memory use remains stable when hammering the server with consecutive no-op SFTP connections in a loop.
To post a comment you must log in.