Use task_serializer for doing roundtrip serialization for eager tasks#5342
Merged
auvipy merged 2 commits intocelery:masterfrom Feb 17, 2019
Merged
Use task_serializer for doing roundtrip serialization for eager tasks#5342auvipy merged 2 commits intocelery:masterfrom
auvipy merged 2 commits intocelery:masterfrom
Conversation
auvipy
requested changes
Feb 16, 2019
Member
auvipy
left a comment
There was a problem hiding this comment.
it would be great if you could add a test for this!
Contributor
Author
|
I'll add one. |
Codecov Report
@@ Coverage Diff @@
## master #5342 +/- ##
=======================================
Coverage 83.56% 83.56%
=======================================
Files 143 143
Lines 16335 16335
Branches 2030 2030
=======================================
Hits 13651 13651
Misses 2481 2481
Partials 203 203
Continue to review full report at Codecov.
|
auvipy
approved these changes
Feb 17, 2019
jeyrce
pushed a commit
to jeyrce/celery
that referenced
this pull request
Aug 25, 2021
…celery#5342) * Use task_serializer for doing roundtrip serialization for eager tasks * Add test for serialization settings
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
Fixes #5133
When doing the roundtrip serialization for eager tasks, the task serializer will always be JSON unless the
serializerargument is present in the call toTask.apply_async. If the serializer argument is present but is'pickle', an exception will be raised as pickle-serialized objects cannot be deserialized without specifying toserialization.loadswhat content types should be accepted. The Producer'sserializerseems to be set toNone, causing the default to JSON serialization.This PR will continue using (in order) the
serializerargument toTask.apply_async, if present, or theProducer's serializer if notNone. If theProducer's serializer isNone, it will use the Celery app'stask_serializerconfiguration entry as the serializer.