Merge lp:~gary/launchpad/bug531071 into lp:launchpad

Proposed by Gary Poster
Status: Merged
Approved by: Данило Шеган
Approved revision: no longer in the source branch.
Merged at revision: 10897
Proposed branch: lp:~gary/launchpad/bug531071
Merge into: lp:launchpad
Diff against target: 33 lines (+5/-4)
1 file modified
lib/lp/translations/browser/translationmessage.py (+5/-4)
To merge this branch: bzr merge lp:~gary/launchpad/bug531071
Reviewer Review Type Date Requested Status
Данило Шеган (community) Approve
Review via email: mp+25618@code.launchpad.net

Commit message

address the primary memory leak discovered for bug 531071.

Description of the change

This branch addresses the primary memory leak discovered for bug 531071.

Danilo said the following on IRC: "moving it out of the function declaration is fine, but please do not do any bigger changes (we have a big feature branch in progress and don't want to get too many conflicts) unless it's really critical (i.e. this doesn't help enough)"

In that context, I did the minimum necessary (though my editor cleaned up a single trailing whitespace; I hope that is not painful).

I did not attempt to write a test for the memory leak. I think it would have been possible, but given that this is being refactored soon, I didn't feel it merited the effort involved.

As described in the bug, there's another change to be made in Zope infrastructure, but I do not believe it is pressing once this change is made. I intend for this change to close the bug.

Thank you.

To post a comment you must log in.
Revision history for this message
Данило Шеган (danilo) wrote :

All good.

review: Approve
Revision history for this message
Данило Шеган (danilo) wrote :

You can probably QA this on staging as well by browsing through eg. https://translations.staging.launchpad.net/ubuntu/lucid/+lang/de pages (URLs ending with +translate will use this view), until you get enough leakage to confirm it's happening or not :)

Revision history for this message
Gary Poster (gary) wrote :

Thanks to Danilo's help, I found out that https://translations.launchpad.dev/ubuntu/hoary/+source/evolution/+pots/evolution-2.2/es/+translate will dupe the problem on a developer machine. I'm using that to verify.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/lp/translations/browser/translationmessage.py'
2--- lib/lp/translations/browser/translationmessage.py 2010-04-11 20:04:15 +0000
3+++ lib/lp/translations/browser/translationmessage.py 2010-05-19 15:31:31 +0000
4@@ -295,7 +295,7 @@
5 'Anonymous users or users who are not accepting our '
6 'licensing terms cannot do POST submissions.')
7 translations_person = ITranslationsPerson(self.user)
8- if (translations_person.translations_relicensing_agreement
9+ if (translations_person.translations_relicensing_agreement
10 is not None and
11 not translations_person.translations_relicensing_agreement):
12 raise UnexpectedFormData, (
13@@ -1553,6 +1553,10 @@
14 is_empty=False))
15 self.seen_translations = seen_translations
16
17+
18+class Submission:
19+ """A submission generated from a TranslationMessage"""
20+
21 def convert_translationmessage_to_submission(
22 message, current_message, plural_form, pofile, legal_warning_needed,
23 is_empty=False, packaged=False):
24@@ -1565,9 +1569,6 @@
25 :param is_empty: Is the submission empty or not.
26 """
27
28- class Submission:
29- pass
30-
31 submission = Submission()
32 submission.translationmessage = message
33 for attribute in ['id', 'language', 'potmsgset', 'pofile',