-
-
Notifications
You must be signed in to change notification settings - Fork 4.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Propagate serializer change to AsynPool._create_write_handlers.send_job
#9091
Open
11 of 19 tasks
Labels
Comments
After replacing celery/celery/concurrency/asynpool.py Line 705 in 418cf33
loads=pickle_loads by loads=dill.loads in
def _recv(timeout, loads=pickle_loads): (billiard/billiard/pool.py#444) , the issue is no more! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Checklist
main
branch of Celery.contribution guide
on reporting bugs.
for similar or identical bug reports.
for existing proposed fixes.
to find out if the bug was already fixed in the main branch.
in this issue (If there are none, check this box anyway).
Mandatory Debugging Information
celery -A proj report
in the issue.(if you are not able to do this, then at least specify the Celery
version affected).
main
branch of Celery.pip freeze
in the issue.to reproduce this bug.
Optional Debugging Information
and/or implementation.
result backend.
broker and/or result backend.
ETA/Countdown & rate limits disabled.
and/or upgrading Celery and its dependencies.
Related Issues and Possible Duplicates
Related Issues
send_task
ignores serializer property on task #8542Possible Duplicates
send_task
ignores serializer property on task #8542Environment & Settings
Celery version: 5.4.0
celery report
Output:Steps to Reproduce
Required Dependencies
Python Packages
pip freeze
Output:Other Dependencies
N/A
Minimally Reproducible Test Case
main.py
worker.py
Expected Behavior
While the default serializer
pickle.dumps
is not able to serialize objects in<locals>
(such as lambdas or dynamically generated classes' instances), thedill.dumps
serializer is able to do so.I then expected the worker to print
"HelloHello"
.Actual Behavior
The worker raises the same serialization error as the client when the
dill.dumps
serializer was not used.Back trace
This seems to indicate that the arguments are somewhere serialized with the default
pickle.dumps
serializer after their reception by the worker.The stack trace points to the
AsynPool._create_write_handlers.send_job
method, which uses thedumps
parameter of theAsynPool._create_write_handlers
method. The default value of this parameter ispickle.dumps
and is not overwritten in theAsynPool.register_with_event_loop
method where_create_write_handlers
is called. This confirms the theory of the serialization attempt with the defaultpickle.dumps
serializer.I have also confirmed that the workers correctly receive the task parameter with the
dill.dumps
serializer, by using breakpoints to successfully use the deserialized objects.Additional notes
To have more information on the reasoning behind this attempt and about the successive steps I went through to find this, please see the following Stack Overflow post.
I also have tried discussing this problem in the Github Celery Discussions page
The text was updated successfully, but these errors were encountered: