Skip to content

Commit

Permalink
fix(celery): remove reference to github issue (DataDog#5381)
Browse files Browse the repository at this point in the history
The issue referenced was
[resolved](celery/celery#6374), but it actually
does not apply to the bit of code it's pointing to.

Fixes DataDog#4649

I tried removing the code referenced by the comment, and it causes the
test
`tests/contrib/celery/test_integration.py::CeleryDistributedTracingIntegrationTask::test_distributed_tracing_propagation_async`
to fail. As far as I can tell from about an hour of investigation, the
celery [fix](celery/celery#4356) only affects
"hybrid messages" (those that blend protocol 1 and 2 syntax as part of a
rolling Celery upgrade), which our test suite doesn't use.
  • Loading branch information
emmettbutler authored and IlyaMichlin committed Mar 30, 2023
1 parent b200840 commit 530c81f
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions ddtrace/contrib/celery/signals.py
Expand Up @@ -134,9 +134,7 @@ def trace_before_publish(*args, **kwargs):
trace_headers = {}
propagator.inject(span.context, trace_headers)

# This weirdness is due to yet another Celery bug concerning
# how headers get propagated in async flows
# https://github.com/celery/celery/issues/4875
# put distributed trace headers where celery will propagate them
task_headers = kwargs.get("headers") or {}
task_headers.setdefault("headers", {})
task_headers["headers"].update(trace_headers)
Expand Down

0 comments on commit 530c81f

Please sign in to comment.