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
Anomalous AdminMiddleware serialization behavior #71
Comments
You'll have to set up a custom encoder to be able to serialize UUIDs. See: https://dramatiq.io/reference.html#dramatiq.Encoder You can set a custom encoder in your settings using the |
@Bogdanp Thanks for your answer. Just to be sure: is a custom encoder needed even if what’s not json serializable are local variables in the task? Please note that in the code I provided there’s no UUID in the task argument, it’s a plain dict with both key and value as strings, that shouldn’t have any serialization issue. The UUID is created in the body of the task, which should be executed in the worker. Thanks |
@sanjioh sorry! I misread your code. I'll take another look this weekend because that is odd. |
No problem, thanks for your help! 👍🏻 |
@sanjioh are you creating/overwriting custom message_ids in one of your middlewares? :) I took a quick glance into the code and the only situation where this issue might crop up, as far as I can see, is when |
Hi @AndreCimander , no, I'm not fiddling with |
Thanks for providing the reproduction repo, @sanjioh . I opened a PR with a fix: sanjioh/django-dramatiq-repro#2 |
Hi,
first of all, thanks for your work on dramatiq and django-dramatiq.
I'd like to report a strange behaviour of the
AdminMiddleware
, in which it raises an exception upon task serialization.Full reproducer at: https://github.com/sanjioh/django-dramatiq-repro
The core of the problem seems to be in the following files:
views.py
tasks.py
Stacktrace:
Please let me know if I can provide further details.
Thanks,
Fabio
The text was updated successfully, but these errors were encountered: