Merge lp:~allenap/launchpad/rabbit-fixture-sigpipe into lp:launchpad

Proposed by Gavin Panella
Status: Merged
Approved by: Gavin Panella
Approved revision: no longer in the source branch.
Merged at revision: 13228
Proposed branch: lp:~allenap/launchpad/rabbit-fixture-sigpipe
Merge into: lp:launchpad
Diff against target: 37 lines (+5/-4)
2 files modified
lib/lp/services/rabbit/testing/server.py (+5/-0)
lib/lp/services/rabbit/tests/test_fixture.py (+0/-4)
To merge this branch: bzr merge lp:~allenap/launchpad/rabbit-fixture-sigpipe
Reviewer Review Type Date Requested Status
Gavin Panella (community) Approve
Review via email: mp+64531@code.launchpad.net

Commit message

[no-qa] [r=allenap][bug=788557] Reset the SIGPIPE handler when spawning RabbitMQ.

Description of the change

As suggested by lifeless, this branch follows the advice in http://bugs.python.org/issue1652 and sets the SIGPIPE handlers back to the default in the first forked child when spawning RabbitMQ. Let's see if it works.

To post a comment you must log in.
Revision history for this message
Gavin Panella (allenap) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/services/rabbit/testing/server.py'
2--- lib/lp/services/rabbit/testing/server.py 2011-05-25 16:00:37 +0000
3+++ lib/lp/services/rabbit/testing/server.py 2011-06-14 10:58:30 +0000
4@@ -12,6 +12,7 @@
5 import errno
6 import os
7 import re
8+import signal
9 import socket
10 import subprocess
11 import sys
12@@ -92,6 +93,10 @@
13 # print '## Starting', name, '##'
14 os.setsid()
15
16+ # Revert Python's handling of SIGPIPE. See
17+ # http://bugs.python.org/issue1652 for more info.
18+ signal.signal(signal.SIGPIPE, signal.SIG_DFL)
19+
20 # fork 2 - now detach once more free and clear
21 pid = os.fork()
22 if pid:
23
24=== modified file 'lib/lp/services/rabbit/tests/test_fixture.py'
25--- lib/lp/services/rabbit/tests/test_fixture.py 2011-05-26 10:44:17 +0000
26+++ lib/lp/services/rabbit/tests/test_fixture.py 2011-06-14 10:58:30 +0000
27@@ -58,10 +58,6 @@
28 class TestRabbitFixture(TestCase):
29
30 def test_start_check_shutdown(self):
31- # XXX: GavinPanella 2011-05-26 bug=788557 : Disabled due to spurious
32- # failures (cannot create cookie file).
33- self.skip("Disabled (bug 788557)")
34-
35 # Rabbit needs to fully isolate itself: an existing per user
36 # .erlange.cookie has to be ignored, and ditto bogus HOME if other
37 # tests fail to cleanup.