Checklist
Mandatory Debugging Information
Optional Debugging Information
Related Issues and Possible Duplicates
Related Issues
Possible Duplicates
Environment & Settings
Celery version:
celery report Output:
Steps to Reproduce
Required Dependencies
- Minimal Python Version: N/A or Unknown
- Minimal Celery Version: N/A or Unknown
- Minimal Kombu Version: N/A or Unknown
- Minimal Broker Version: N/A or Unknown
- Minimal Result Backend Version: N/A or Unknown
- Minimal OS and/or Kernel Version: N/A or Unknown
- Minimal Broker Client Version: N/A or Unknown
- Minimal Result Backend Client Version: N/A or Unknown
Python Packages
pip freeze Output:
Other Dependencies
Details
N/A
Minimally Reproducible Test Case
Details
Expected Behavior
When result_extended is set to True, we expect to get the task name using the name attribute.
Actual Behavior
The name is always None, after debugging the Context object that is being passed to BaseKeyValueStoreBackend.store_result it contains the task name with the attribute task and not task_name as BaseKeyValueStoreBackend._store_result is trying to get from the request object:
if self.app.conf.find_value_for_key('extended', 'result'):
if request:
request_meta = {
'name': getattr(request, 'task_name', None),
'args': getattr(request, 'args', None),
'kwargs': getattr(request, 'kwargs', None),
'worker': getattr(request, 'hostname', None),
'retries': getattr(request, 'retries', None),
'queue': request.delivery_info.get('routing_key')
if hasattr(request, 'delivery_info') and
request.delivery_info else None
}
meta.update(request_meta)
Also the unit test test_result.test_AsyncResult.test_get_request_meta is using a Context object with an explicit task_name set.
Checklist
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 master branch.
in this issue (If there are none, check this box anyway).
Mandatory Debugging Information
celery -A proj reportin the issue.(if you are not able to do this, then at least specify the Celery
version affected).
masterbranch of Celery.pip freezein 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
Possible Duplicates
Environment & Settings
Celery version:
celery reportOutput:Steps to Reproduce
Required Dependencies
Python Packages
pip freezeOutput:Other Dependencies
Details
N/A
Minimally Reproducible Test Case
Details
Expected Behavior
When
result_extendedis set toTrue, we expect to get the task name using thenameattribute.Actual Behavior
The
nameis alwaysNone, after debugging theContextobject that is being passed toBaseKeyValueStoreBackend.store_resultit contains the task name with the attributetaskand nottask_nameasBaseKeyValueStoreBackend._store_resultis trying to get from the request object:Also the unit test
test_result.test_AsyncResult.test_get_request_metais using aContextobject with an explicittask_nameset.