Merge lp:~cjwatson/rabbitfixture/less-aggressive-sigterm into lp:rabbitfixture

Proposed by Colin Watson
Status: Merged
Merged at revision: 57
Proposed branch: lp:~cjwatson/rabbitfixture/less-aggressive-sigterm
Merge into: lp:rabbitfixture
Diff against target: 33 lines (+8/-1)
2 files modified
NEWS.rst (+7/-0)
rabbitfixture/server.py (+1/-1)
To merge this branch: bzr merge lp:~cjwatson/rabbitfixture/less-aggressive-sigterm
Reviewer Review Type Date Requested Status
Andrey Fedoseev (community) Approve
Review via email: mp+429256@code.launchpad.net

Commit message

Only send SIGTERM once while stopping RabbitServerRunner.

Description of the change

It's sent to the whole process group, and that can itself interfere with the shutdown process if we send it frequently and repeatedly. I noticed that Launchpad's `RabbitMQLayer` was oddly slow to shut down sometimes, and tracked that down to this.

To post a comment you must log in.
Revision history for this message
Andrey Fedoseev (andrey-fedoseev) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'NEWS.rst'
2--- NEWS.rst 2022-07-22 22:25:15 +0000
3+++ NEWS.rst 2022-09-01 00:03:38 +0000
4@@ -2,6 +2,13 @@
5 NEWS for rabbitfixture
6 ======================
7
8+0.5.2
9+=====
10+
11+- Only send ``SIGTERM`` once while stopping ``RabbitServerRunner``, since
12+ it's sent to the whole process group and that can itself interfere with
13+ the shutdown process if we send it frequently and repeatedly.
14+
15 0.5.1 (2022-07-22)
16 ==================
17
18
19=== modified file 'rabbitfixture/server.py'
20--- rabbitfixture/server.py 2022-07-22 19:41:42 +0000
21+++ rabbitfixture/server.py 2022-09-01 00:03:38 +0000
22@@ -452,10 +452,10 @@
23
24 # Wait for the process to end...
25 timeout = max(timeout, time.time() + self.environment.ctltimeout)
26+ self._signal(signal.SIGTERM)
27 while time.time() < timeout:
28 if not self.is_running():
29 break
30- self._signal(signal.SIGTERM)
31 time.sleep(0.1)
32 else:
33 # Die!!!

Subscribers

People subscribed via source and target branches

to all changes: