Move statistics updating outside the web browser code
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Critical
|
Benji York | ||
Ubuntu Translations |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
At the moment, we have a lot of problems with translation statistics not being updated real-time even though we make every attempt to do so. I am suspecting this fails mostly due to timeouts in POSTs when we issue POFile.
We have so far solved this with band-aids like cronscripts/
Instead of trying to fix our band-aids, we should fix the root cause instead. We know that sometimes it's going to be impossible to both save all the changes on a single +translate page *and* calculate the statistics (eg. ddtp-ubuntu templates are over 40k messages total) in a single POST, and we also know that statistics being very up-to-date real-time is not essential (we have gotten translators used to them being a week or so behind; having them eg. 5 minute behind at *most* would be a huge improvement).
So, we should instead decouple translation saving from statistics update. I propose we move any updateStatistics calls from the browser code (though, there should be only one) to a job which is scheduled to run whenever there are changes to a POFile. We should also extend updateStatistics call to support finding all the sharing POFiles as well (all the potentially touched POFiles).
The same should be done for POTemplate.
Other updateStatistics callsites (eg. in model/pofile.py and another one in model/potemplate.py importFromQueue) are related to imports which are already de-coupled from the browser code, so can (and should) stay "inline". Having them fix the statistics for all the sharing POFiles would be nothing but an improvement.
Once all of the above is done, we should be able to kill rosetta-
Fixing this bug would solve bug 781274 (a critical regression) and bug 622668, thus marking this one as critical and adding notes there.
Related branches
- j.c.sackett (community): Approve
-
Diff: 253 lines (+197/-4)6 files modifiedlib/canonical/config/schema-lazr.conf (+7/-0)
lib/lp/translations/browser/translationmessage.py (+3/-4)
lib/lp/translations/configure.zcml (+9/-0)
lib/lp/translations/interfaces/pofilestatsjob.py (+16/-0)
lib/lp/translations/model/pofilestatsjob.py (+88/-0)
lib/lp/translations/tests/test_pofilestatsjob.py (+74/-0)
- Robert Collins: Pending requested
- Stuart Bishop: Pending (db) requested
-
Diff: 54 lines (+12/-3)3 files modifieddatabase/schema/comments.sql (+0/-3)
database/schema/patch-2208-93-0.sql (+9/-0)
database/schema/security.cfg (+3/-0)
- Robert Collins (community): Approve
- Stuart Bishop (community): Approve (db)
-
Diff: 54 lines (+12/-3)3 files modifieddatabase/schema/comments.sql (+0/-3)
database/schema/patch-2208-93-0.sql (+9/-0)
database/schema/security.cfg (+3/-0)
- Benji York (community): Approve
-
Diff: 13 lines (+3/-0)1 file modifieddatabase/schema/security.cfg (+3/-0)
description: | updated |
Changed in launchpad: | |
importance: | High → Critical |
Changed in launchpad: | |
assignee: | nobody → Benji York (benji) |
tags: |
added: qa-untestable removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → In Progress |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
Changed in launchpad: | |
status: | Fix Released → In Progress |
tags: |
added: qa-ok removed: qa-needstesting |
Changed in launchpad: | |
status: | Fix Committed → Fix Released |
Changed in ubuntu-translations: | |
status: | New → Fix Released |
Fixed in db-stable r11143 <http:// bazaar. launchpad. net/~launchpad- pqm/launchpad/ db-stable/ revision/ 11143>.