Merge lp://staging/~edwin-grubbs/launchpad/bug-590840-getMembershipInformation-timeout into lp://staging/launchpad

Proposed by Edwin Grubbs
Status: Merged
Approved by: Edwin Grubbs
Approved revision: no longer in the source branch.
Merged at revision: 10996
Proposed branch: lp://staging/~edwin-grubbs/launchpad/bug-590840-getMembershipInformation-timeout
Merge into: lp://staging/launchpad
Diff against target: 113 lines (+23/-31)
2 files modified
lib/lp/registry/model/mailinglist.py (+21/-30)
lib/lp/services/mailman/doc/staging.txt (+2/-1)
To merge this branch: bzr merge lp://staging/~edwin-grubbs/launchpad/bug-590840-getMembershipInformation-timeout
Reviewer Review Type Date Requested Status
Michael Nelson (community) code Approve
Review via email: mp+27108@code.staging.launchpad.net

Description of the change

Summary
-------

The MailingListAPIView.getMembershipInformation() method in
canonical.launchpad.xmlrpc.mailinglist was causing soft timeouts
(See OOPS-1612S995).

This was caused by the MailingListSet.getSenderAddresses(team_names)
retrieving all the columns from the tables being joined instead of
just the three columns actually needed.

Implementation details
----------------------

Improved performance of getSenderAddresses(team_names):
    lib/lp/registry/model/mailinglist.py

Drive-by testfix. I'm not sure if this test is being run by buildbot,
since it didn't look like it could possibly work otherwise.
    lib/lp/services/mailman/doc/staging.txt

Tests
-----

./bin/test -vv -t mailinglist
./bin/test -vv --layer=Mailman

To post a comment you must log in.
Revision history for this message
Michael Nelson (michael.nelson) wrote :

Great, thanks Edwin. Small note below that you can choose to ignore.

> === modified file 'lib/lp/registry/model/mailinglist.py'
> --- lib/lp/registry/model/mailinglist.py 2010-04-23 15:19:10 +0000
> +++ lib/lp/registry/model/mailinglist.py 2010-06-10 13:10:37 +0000
> @@ -729,20 +726,13 @@
> Person.teamowner != None))
> )
> team_members = store.using(*tables).find(
> - (EmailAddress, MailingList, Person, Team),
> + (Team.name, Person.displayname, EmailAddress.email),
> And(TeamParticipation.teamID.is_in(team_ids),

I only realised that it wasn't part of your change after testing it, but the And expression is not needed here. Up to you (other examples follow too.

review: Approve (code)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
The diff is not available at this time. You can reload the page or download it.