Merge lp:~barry/launchpad/403606-expat into lp:launchpad
Proposed by
Barry Warsaw
Status: | Merged |
---|---|
Merged at revision: | not available |
Proposed branch: | lp:~barry/launchpad/403606-expat |
Merge into: | lp:launchpad |
Diff against target: |
278 lines 9 files modified
lib/canonical/launchpad/mailman/monkeypatches/lpmoderate.py (+2/-1) lib/canonical/launchpad/webapp/publication.py (+1/-1) lib/canonical/launchpad/webapp/servers.py (+1/-0) lib/canonical/launchpad/xmlrpc/mailinglist.py (+11/-2) lib/lp/registry/doc/mailinglist-xmlrpc.txt (+7/-6) lib/lp/registry/doc/message-holds-xmlrpc.txt (+50/-1) lib/lp/registry/interfaces/mailinglist.py (+2/-2) lib/lp/services/mailman/doc/create-lists.txt (+2/-2) lib/lp/services/mailman/doc/postings.txt (+32/-0) |
To merge this branch: | bzr merge lp:~barry/launchpad/403606-expat |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
Paul Hummer (community) | code | Approve | |
Canonical Launchpad Engineering | Pending | ||
Review via email: mp+12734@code.launchpad.net |
To post a comment you must log in.
= Summary =
Bug 403606 is a fun one. For a long while now, we've been getting mysterious
OOPSes in the private XMLRPC server that Mailman talks too. Unfortunately,
Zope swallows all the information that would be useful to diagnose the
problem. OTOH, it never seemed to degrade the service, but it annoyed the
LOSAs and helping them out is always a good thing!
Now that 3.0 is out, it was time to look into this problem, so with the LOSAs
help, I instrumented the private server to gather the additional information.
Specifically, I added some code so that when the XMLRPC request failed, I
logged the entire request body. We ran that code overnight and it was obvious
what the problem was.
It turns out that IMailingListAPI View.holdMessag e() is the culprit, and
specifically it's when Mailman tries to hold messages with non-ascii
characters in its headers or body. This makes sense as non-ascii must be
encoded over the wire for XMLRPC.
The downside is that all the messages in the overnight log that I could see
that triggered this were spam. That jives with my experience in Mailman (why
spammers would send at worst illegal or at best often incompatible messages is
beyond me, but there ya go). So the good news is that this should eliminate
or at least largely reduce the OOPSes we're seeing, but the bad news is that
it will probably increase the amount of spam list owners have to moderate.
That is a separate problem though, out of scope for this branch (and we have
ways of mitigating that).
== Proposed fix ==
On the XMLRPC client side in Mailman, wrap the message body texts in an
xmlrpc.Binary for transport over the wire. On the private XMLRPC server side,
unwrap the Binary to get the text bytes of the original message.
== Pre-implementation notes ==
I didn't have any discussions specifically about this fix, but had several
discussions with the LOSAs, Brad, and Francis about how to diagnose the
problem.
== Implementation details ==
A few things to note. On the server side, I do a type-test of the 'bytes'
argument to see whether to unwrap the Binary or not. The reason I don't do
this unconditionally is that it would require a rewrite of all the existing
tests, where most of the message bodies are pure-ascii. So while the client
always sends a Binary, most of the tests will still send strings.
I paid some tech debt along the way. Apologies for cluttering up the meat of
this change.
== Tests ==
% bin/test -vv -t mailinglist- xmlrpc. txt MailmanLayer -t create-list -t postings
% bin/test -vv --layer=
Note that the MailmanLayer tests are sometimes flaky and are not run by 'make
check' by default. Still, you should be able to get through them, though ping
me if you can't.
== Demo and Q/A ==
There are no user visible changes on this branch, but we'll QA it by watching
the daily OOPS reports.
= Launchpad lint =
These lint warnings are bogus.
Checking for conflicts. and issues in doctests and templates.
Running jslint, xmllint, pyflakes, and pylint.
Using normal rules.
Linting changed files: services/ mailman/ doc/postings. txt /launchpad/ webapp/ publication. py /launchpad/ mailman/ monkeypatches/ lp...
lib/lp/
lib/canonical
lib/canonical