Merge lp:~flacoste/launchpad/bug-889025 into lp:launchpad

Proposed by Francis J. Lacoste
Status: Merged
Approved by: Curtis Hovey
Approved revision: no longer in the source branch.
Merged at revision: 14290
Proposed branch: lp:~flacoste/launchpad/bug-889025
Merge into: lp:launchpad
Diff against target: 82 lines (+30/-1)
4 files modified
lib/canonical/config/schema-lazr.conf (+16/-1)
lib/lp/services/mailman/monkeypatches/__init__.py (+3/-0)
lib/lp/services/mailman/monkeypatches/mm_cfg.py.in (+2/-0)
lib/lp/services/mailman/tests/test_mm_cfg.py (+9/-0)
To merge this branch: bzr merge lp:~flacoste/launchpad/bug-889025
Reviewer Review Type Date Requested Status
Curtis Hovey (community) code Approve
Review via email: mp+82030@code.launchpad.net

Commit message

[r=sinzui][bug=889025,889283][no-qa] Increase xmlrpc_timeout to be higher than LP default timeout. Make Mailman SMTP_MAX_RCPTS and SMTP_MAX_MESSAGES_PER_CONNECTION configurable and with defaults sane for our Exim setup.

Description of the change

This makes two more Mailman configuration variable settable through the LP config system.

It also changes the defaults for these. The default smtp_max_messages_per_connection was higher than
the one acceptable by Exim causing error in production. 200 is the same default than Exim and should prevent
these errors.

The xmlrpc timeout was also increased so that Mailman doesn't timeout before Launchpad does.

To post a comment you must log in.
Revision history for this message
Curtis Hovey (sinzui) wrote :

Thank you for spotting the disconnect between mailman and exim.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/canonical/config/schema-lazr.conf'
2--- lib/canonical/config/schema-lazr.conf 2011-10-26 02:14:52 +0000
3+++ lib/canonical/config/schema-lazr.conf 2011-11-11 22:12:24 +0000
4@@ -1382,8 +1382,10 @@
5 # datatype: integer
6 xmlrpc_runner_sleep: 10
7
8+# Socket timeout on XML-RPC connections made by Mailman.
9+# This should at least be higher than the LP request timeout.
10 # datatype: integer
11-xmlrpc_timeout: 5
12+xmlrpc_timeout: 10
13
14 # How often do we run the bounce processor? For production, the default 15
15 # minutes is fine, for testing we want to run it more often.
16@@ -1394,6 +1396,19 @@
17 # datatype: string
18 smtp: localhost:25
19
20+# Ceiling on the number of recipients that can be specified in a single SMTP
21+# transaction. Set to 0 to submit the entire recipient list in one
22+# transaction.
23+# WARNING: Make sure that this matches the limits on the SMTP host!
24+# datatype: integer
25+smtp_max_rcpts: 50
26+
27+# Ceiling on the number of SMTP sessions to perform on a single socket
28+# connection.
29+# WARNING: Make sure that this matches the limits on the SMTP host!
30+# datatype: integer
31+smtp_max_sesions_per_connection: 200
32+
33 # The list owner header is a template URL that may contain
34 # $team_name in it.
35 # datatype: string
36
37=== modified file 'lib/lp/services/mailman/monkeypatches/__init__.py'
38--- lib/lp/services/mailman/monkeypatches/__init__.py 2011-07-27 15:25:32 +0000
39+++ lib/lp/services/mailman/monkeypatches/__init__.py 2011-11-11 22:12:24 +0000
40@@ -61,6 +61,9 @@
41 launchpad_top=launchpad_top,
42 smtp_host=host,
43 smtp_port=port,
44+ smtp_max_rcpts=config.mailman.smtp_max_rcpts,
45+ smtp_max_sesions_per_connection
46+ =config.mailman.smtp_max_sesions_per_connection,
47 xmlrpc_url=config.mailman.xmlrpc_url,
48 xmlrpc_sleeptime=config.mailman.xmlrpc_runner_sleep,
49 xmlrpc_timeout=config.mailman.xmlrpc_timeout,
50
51=== modified file 'lib/lp/services/mailman/monkeypatches/mm_cfg.py.in'
52--- lib/lp/services/mailman/monkeypatches/mm_cfg.py.in 2011-07-27 15:25:32 +0000
53+++ lib/lp/services/mailman/monkeypatches/mm_cfg.py.in 2011-11-11 22:12:24 +0000
54@@ -22,6 +22,8 @@
55 # Our dynamic overrides of all the static defaults.
56 SMTPHOST = '%(smtp_host)s'
57 SMTPPORT = %(smtp_port)d
58+SMTP_MAX_RCPTS = %(smtp_max_rcpts)d
59+SMTP_MAX_SESSIONS_PER_CONNECTION = %(smtp_max_sesions_per_connection)d
60
61 # Configuration options for the XMLRPCRunner.
62 XMLRPC_URL = '%(xmlrpc_url)s'
63
64=== modified file 'lib/lp/services/mailman/tests/test_mm_cfg.py'
65--- lib/lp/services/mailman/tests/test_mm_cfg.py 2011-03-31 14:19:28 +0000
66+++ lib/lp/services/mailman/tests/test_mm_cfg.py 2011-11-11 22:12:24 +0000
67@@ -85,6 +85,15 @@
68 self.assertEqual(host, mm_cfg.SMTPHOST)
69 self.assertEqual(int(port), mm_cfg.SMTPPORT)
70
71+ def test_smtp_max_config(self):
72+ # Mailman SMTP max limits are configured from the LP config.
73+ self.assertEqual(
74+ config.mailman.smtp_max_rcpts,
75+ mm_cfg.SMTP_MAX_RCPTS)
76+ self.assertEqual(
77+ config.mailman.smtp_max_sesions_per_connection,
78+ mm_cfg.SMTP_MAX_SESSIONS_PER_CONNECTION)
79+
80 def test_xmlrpc_server(self):
81 # Launchpad's smtp config values.
82 self.assertEqual(