Skip to content
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

Breaking change: task_name no longer set on TaskResult #334

Open
ahosie opened this issue Jul 25, 2022 · 4 comments
Open

Breaking change: task_name no longer set on TaskResult #334

ahosie opened this issue Jul 25, 2022 · 4 comments

Comments

@ahosie
Copy link

ahosie commented Jul 25, 2022

django-celery-results no longer sets the value of TaskResult.task_name as of v2.4.0.
This change was made purportedly to resolve a security issue and/or to fix an inconsistency with the implementation versus documentation.

For anyone else that encounters this, you might be able to resolve by setting the Django config property:

# This belongs in settings.py for your project
CELERY_RESULT_EXTENDED = True

If your app is instantiating the celery worker at runtime (e.g. a test runner), you can override the config like so:

app = Celery('mytestapp', broker='memory://')
app.config_from_object(dict(result_extended=True))

Keep in mind that this will re-introduce the security issue that #315/v2.4.0 was intended to fix.

@ahosie
Copy link
Author

ahosie commented Jul 25, 2022

Maintainers: please note that if you patch this to restore previous behaviour of the task_name, in a new minor release, it may not get picked up by people like me who use dependabot to keep libraries up to date.

@auvipy
Copy link
Member

auvipy commented Jul 25, 2022

this was already discussed #326 (comment)

@ahosie
Copy link
Author

ahosie commented Jul 25, 2022

this was already discussed #326 (comment)

Somehow missed this closed issue when I was searching. Apologies.

In my opinion this issue should remain opened - the change in 2.4.0 represents an undocumented regression. It will likely break a bunch of applications, and possibly in subtle ways that won't be found for a while.

Removing the the task_name in goes beyond addressing the security vuln identified in storing arguments, (which is debatable as a vuln in the first place).

@ahosie
Copy link
Author

ahosie commented Jul 25, 2022

Note: the Celery v3/v4 documentation does not contain:

result_extended
Enables extended task result attributes (name, args, kwargs, worker, retries, queue, delivery_info) to be written to backend.

This behaviour is absolutely a change, as indicated by the large number of issues been raised in the last month, and is not covered in the release notes for django-celery-results, nor any of the "what's new" pages for Celery.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants