Don't pass objects to celery tasks

RESOLVED WONTFIX

Status

Marketplace
Code Quality
P3
normal
RESOLVED WONTFIX
3 years ago
2 years ago

People

(Reporter: mstriemer, Unassigned)

Tracking

Avenir
Points:
---

Details

(Whiteboard: [marketplace-transition])

(Reporter)

Description

3 years ago
There are some places where we pass objects to celery tasks, this worked fine when we used pickle to serialize but we should use JSON instead since it is safer. This occurs in several places, especially around resizing things and using the `set_modified_on` helper.

Change the serializer (CELERY_ACCEPT_CONTENT, CELERY_TASK_SERIALIZER, CELERY_RESULT_SERIALIZER) to "json" when you're done.
On a quick scan the tasks I found were the following but the bug assignee should review also:

./lib/video/tasks.py:resize_video
./mkt/developers/tasks.py:resize_preview
./mkt/developers/tasks.py:fetch_icon
./mkt/developers/tasks.py:region_email
./mkt/developers/tasks.py:region_exclude
./mkt/developers/tasks.py:save_test_plan
./mkt/files/tasks.py:extract_file
./mkt/site/tasks.py:send_email
./mkt/site/tasks.py:set_modified_on_object
./mkt/websites/tasks.py:fetch_icon
Priority: -- → P3
Whiteboard: [ktlo]
Assignee: nobody → robhudson.mozbugs
https://github.com/mozilla/zamboni/pull/3137

Flagging as [qa-]. I will watch server side logs for any tasks that are failing b/c of this change.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → FIXED
Whiteboard: [ktlo] → [ktlo][qa-]
Target Milestone: --- → 2015-07-07
Reopening after https://github.com/mozilla/zamboni/commit/f18b31c73267e29704baca0cc2e1485bf927eece
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
I wasn't able to finish the pull request but it could be a start for someone else:
https://github.com/mozilla/zamboni/pull/3330
Assignee: robhudson.mozbugs → nobody
Target Milestone: 2015-07-07 → ---
Status: REOPENED → RESOLVED
Last Resolved: 3 years ago2 years ago
Resolution: --- → WONTFIX
Whiteboard: [ktlo][qa-] → [marketplace-transition]
You need to log in before you can comment on or make changes to this bug.