Merge lp:~wgrant/launchpad/bug-1408557-mitigate into lp:launchpad

Proposed by William Grant
Status: Merged
Merged at revision: 17301
Proposed branch: lp:~wgrant/launchpad/bug-1408557-mitigate
Merge into: lp:launchpad
Diff against target: 14 lines (+3/-1)
1 file modified
lib/lp/services/librarianserver/storage.py (+3/-1)
To merge this branch: bzr merge lp:~wgrant/launchpad/bug-1408557-mitigate
Reviewer Review Type Date Requested Status
William Grant code Approve
Review via email: mp+246022@code.launchpad.net

Commit message

Mitigate librarian swift FD leaks (bug #1408557) by reusing connections on 404.

Description of the change

Mitigate librarian swift FD leaks (bug #1408557) by reusing connections on 404.

This isn't a complete fix, but it's worked on production for a couple of days.

To post a comment you must log in.
Revision history for this message
William Grant (wgrant) :
review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file 'lib/lp/services/librarianserver/storage.py'
--- lib/lp/services/librarianserver/storage.py 2014-10-17 09:21:23 +0000
+++ lib/lp/services/librarianserver/storage.py 2015-01-09 23:17:01 +0000
@@ -99,7 +99,9 @@
99 swift_stream = TxSwiftStream(swift_connection, chunks)99 swift_stream = TxSwiftStream(swift_connection, chunks)
100 defer.returnValue(swift_stream)100 defer.returnValue(swift_stream)
101 except swiftclient.ClientException as x:101 except swiftclient.ClientException as x:
102 if x.http_status != 404:102 if x.http_status == 404:
103 swift.connection_pool.put(swift_connection)
104 else:
103 self.swift_download_fails += 1105 self.swift_download_fails += 1
104 log.err(x)106 log.err(x)
105 except Exception as x:107 except Exception as x: