-
Notifications
You must be signed in to change notification settings - Fork 207
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
Encode 'task_args' and 'task_kwargs' in 'store_result'. #78
Conversation
Is this a backward incompatible change? |
I think that this change won't break any main functionality, as these fields are just informative or for debugging. For me it's not a problem that the storing format changes. Maybe it's a problem for someone who has a script or something that parse and use these fields. However, they are quite new (the deploy was 2 days ago). |
I don't like the idea to make it an option. I think that not encoding these fields is a bug, because serializing a |
It's a bit off-topic but there is Yes, I agree that Another possibility is to introduce new fields in parallel. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please rebase before you proceed :)
ab04076
to
5822d22
Compare
Rebased |
let's reach a consensus for the changes before the merge. |
I'm pretty sure that the code works. |
Keeping BC is very important. |
So the options are:
Let me know if you come up with other ideas. |
9bb9578
to
2607311
Compare
I would wait for celery 5 and this package 2.0 version |
b074243
to
106007d
Compare
Looks like this particular PR has already been settled as "not yet" but I just wanted to comment on the above: |
Is there anything I can do to help move this forward? |
3d5237e
to
b1c96f9
Compare
Hope that now that Celery 5 is released, it's a good moment to update this package to version 2.0, and merge this PR. |
is it possible to not to break existing systems? |
This PR will only change how new TaskResult instances will store I already suggested a few options:
However, I think that store a |
I just encountered this after solving a similar problem trying to use the JSONField (I was using the postgres contrib one but now merged in Django 3.1: https://docs.djangoproject.com/en/3.1/ref/contrib/postgres/fields/#jsonfield) for task_args and task_kwargs. Perhaps now is the time, with an option or with Django version checking? Happy to provide some code if this approach has potential. |
@arnau126 I tried to check out this PR and I'm still getting |
|
@arnau126 that makes sense, sorry 😅 |
I am accepting this PR, but new fields / better solutions using django new fields etc is wellcome |
So 2.0.0 didn't fix the CVE yet? issue #154 when I saw a new major release I had my hopes up the CVE was fixed but I don't think it has yet. Has version 2.0.0 been flagged yet or is it a matter of time that version gets flagged too? |
Seems like not really working. This is what I need to do to get back task arguments.
Do I correctly understand this commit was aimed to allow simply do |
this is a more recent PR #178 and @arnau126 opened a new PR in celery as well celery/celery#6595 |
Yes, you understand correctly.
You're right, unfortunately not working, because of the new Celery task_protocol=2 and the hide-sensitive-information feature I have a work-in-progress PR (celery/celery#6595) to fix it (to allow simply do |
Encode
task_args
andtask_kwargs
inDatabaseBackend.store_result()
(as we do withmeta
andresult
) so we can retrieve them as python objects later on.Note that this PR changes the serialization format of these fields.
For example, if
args=['a', 1, True, None]
Currently it's stored as :
"['a', 1, True, None]"
and after this PR it will be stored as:
'["a", 1, true, null]'
(json format)