Closed Bug 945236 Opened 11 years ago Closed 10 years ago

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

Categories

(Marketplace Graveyard :: General, defect, P2)

defect

Tracking

(Not tracked)

RESOLVED FIXED
2014-01-28

People

(Reporter: mat, Assigned: mat)

References

Details

(Whiteboard: [qa-])

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: nobody → mpillard
Depends on: 960132
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
Fixed in https://github.com/mozilla/zamboni/commit/3f4de1c2cb75534549c6c84773d1b928d0bd8284
Status: ASSIGNED → RESOLVED
Closed: 10 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.