Merge lp:~brandontschaefer/libertine/close-pipe-fix into lp:libertine

Proposed by Brandon Schaefer
Status: Merged
Approved by: Larry Price
Approved revision: 290
Merged at revision: 291
Proposed branch: lp:~brandontschaefer/libertine/close-pipe-fix
Merge into: lp:libertine
Diff against target: 26 lines (+10/-5)
1 file modified
python/libertine/Libertine.py (+10/-5)
To merge this branch: bzr merge lp:~brandontschaefer/libertine/close-pipe-fix
Reviewer Review Type Date Requested Status
Libertine CI Bot continuous-integration Approve
Larry Price Approve
Review via email: mp+303460@code.launchpad.net

Commit message

If the socket we read from has a closed pair connection
make sure we check if the we get a error closed pipe
and clean up

To post a comment you must log in.
Revision history for this message
Brandon Schaefer (brandontschaefer) wrote :

If the socket we read from has a closed pair connection
  make sure we check if the we get a error closed pipe
  and clean up

Revision history for this message
Larry Price (larryprice) wrote :

lgtm! thanks for the quick fix

review: Approve
Revision history for this message
Libertine CI Bot (libertine-ci-bot) wrote :

PASSED: Continuous integration, rev:290
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/104/
Executed test runs:
    SUCCESS: https://jenkins.canonical.com/libertine/job/build/295
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=vivid+overlay,testname=default/244
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=xenial+overlay,testname=default/244
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=amd64,release=yakkety,testname=default/244
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=vivid+overlay,testname=default/244
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=xenial+overlay,testname=default/244
    SUCCESS: https://jenkins.canonical.com/libertine/job/test-0-autopkgtest/label=i386,release=yakkety,testname=default/244
    None: https://jenkins.canonical.com/libertine/job/lp-generic-update-mp/221/console
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-0-fetch/297
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=vivid+overlay/281
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=xenial+overlay/281
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-1-sourcepkg/release=yakkety/281
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/274
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=vivid+overlay/274/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/274
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=xenial+overlay/274/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/274
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=amd64,release=yakkety/274/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/274
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=vivid+overlay/274/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/274
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=xenial+overlay/274/artifact/output/*zip*/output.zip
    SUCCESS: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/274
        deb: https://jenkins.canonical.com/libertine/job/build-2-binpkg/arch=i386,release=yakkety/274/artifact/output/*zip*/output.zip

Click here to trigger a rebuild:
https://jenkins.canonical.com/libertine/job/lp-libertine-ci/104/rebuild

review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'python/libertine/Libertine.py'
2--- python/libertine/Libertine.py 2016-08-15 22:11:03 +0000
3+++ python/libertine/Libertine.py 2016-08-19 20:51:38 +0000
4@@ -624,12 +624,17 @@
5
6 totalsent = 0
7 while totalsent < len(data):
8- sent = send_sock.send(data)
9-
10- if sent == 0:
11- close_connections(sock)
12+ try:
13+ sent = send_sock.send(data)
14+ except BrokenPipeError as e:
15+ libertine.utils.get_logger().exception(e)
16+ self.close_connections(sock)
17 break
18- totalsent = totalsent + sent
19+ else:
20+ if sent == 0:
21+ close_connections(sock)
22+ break
23+ totalsent = totalsent + sent
24
25
26 class LibertineApplication(object):

Subscribers

People subscribed via source and target branches