mkt.webapps.tasks.update_cached_manifests() is called too often, too soon

RESOLVED FIXED in 2014-01-28

Status

P2
normal
RESOLVED FIXED
5 years ago
5 years ago

People

(Reporter: mat, Assigned: mat)

Tracking

2014-01-28
Points:
---

Details

(Whiteboard: [qa-])

(Assignee)

Description

5 years ago
When a version of an packaged app or an hosted app is made public, in zamboni we call '<addon>.update_version()' which dispatches the signal 'version_changed'. That signal is caught to start the task 'mkt.webapps.tasks.update_cached_manifests()'.

There are 2 problems:

- update_cached_manifests() is only useful for packaged apps. There is a check inside the task itself and inside the method the task calls, and it returns immediately if it's not a packaged app. This means calling the task for hosted apps is pointless, we are just wasting CPU cycles in celery.

- update_version() is called (manually) while we are still inside a transaction, it might not have been committed yet. So sometimes celery doesn't get the updated info and it can lead to weird bugs in sentry.
 - Note: the reviewer views have an hack to commit manually and re-send the post_save afterwards, but both publicise() and version_publicise() methods in the developer pages don't. That hack probably needs to be cleaned up and used in those dev page views as well.

Might be related, might not: http://sentry.mktmon.services.phx1.mozilla.com/mkt/marketplacefirefoxcom/group/215/
cvan to take a looksie then probably give up and give to mat the wizard
Assignee: nobody → cvan
Target Milestone: --- → 2013-12-10
Priority: -- → P3
Priority: P3 → P2
No idea
Assignee: cvan → nobody
Target Milestone: 2013-12-10 → ---
(Assignee)

Updated

5 years ago
Assignee: nobody → mpillard
(Assignee)

Updated

5 years ago
Depends on: 960132
(Assignee)

Comment 3

5 years ago
I'm not sure about the transaction part anymore. I have a PR fixing the first issue, and we'll see about the second once everything is in production.
Status: NEW → ASSIGNED
(Assignee)

Comment 4

5 years ago
Fixed in https://github.com/mozilla/zamboni/commit/3f4de1c2cb75534549c6c84773d1b928d0bd8284
Status: ASSIGNED → RESOLVED
Last Resolved: 5 years ago
Resolution: --- → FIXED
Whiteboard: [qa-]
Target Milestone: --- → 2014-01-28
You need to log in before you can comment on or make changes to this bug.