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

Fix custom headers propagation for protocol 1 hybrid messages #6374

Merged
merged 1 commit into from Sep 30, 2020

Conversation

beezz
Copy link
Contributor

@beezz beezz commented Sep 29, 2020

Note: Before submitting this pull request, please review our contributing
guidelines
.

Description

This is an attempt to fix custom header propagation that broke for us after migration from Celery 3.X to 4.X.

I believe it is the same issue as described in #4875

For the hybrid messages of protocol 1, the message.headers are ignored, this PR merges them with the rest of the headers extracted from the body.

@lgtm-com
Copy link

lgtm-com bot commented Sep 29, 2020

This pull request fixes 1 alert when merging 14e5a84 into ea37db1 - view on LGTM.com

fixed alerts:

  • 1 for Non-exception in 'except' clause

@beezz beezz force-pushed the fix-custom-headers-hybrid-msg branch from 14e5a84 to 1227012 Compare September 29, 2020 20:07
@lgtm-com
Copy link

lgtm-com bot commented Sep 29, 2020

This pull request fixes 2 alerts when merging 1227012 into ea37db1 - view on LGTM.com

fixed alerts:

  • 1 for Non-exception in 'except' clause
  • 1 for Module is imported with 'import' and 'import from'

@beezz beezz force-pushed the fix-custom-headers-hybrid-msg branch from 1227012 to 70ad00e Compare September 29, 2020 21:14
@lgtm-com
Copy link

lgtm-com bot commented Sep 29, 2020

This pull request fixes 2 alerts when merging 70ad00e into ea37db1 - view on LGTM.com

fixed alerts:

  • 1 for Non-exception in 'except' clause
  • 1 for Module is imported with 'import' and 'import from'

@auvipy auvipy merged commit 0f1a53b into celery:master Sep 30, 2020
@beezz beezz deleted the fix-custom-headers-hybrid-msg branch September 30, 2020 10:46
@beezz
Copy link
Contributor Author

beezz commented Sep 30, 2020

Hi @auvipy, thank you very much for taking your time with this PR. What do you think about backporting this fix to 4.x?

@thedrow
Copy link
Member

thedrow commented Sep 30, 2020

@auvipy I've added it to the 4.5 milestone so you won't forget.

@thedrow
Copy link
Member

thedrow commented Dec 3, 2020

@auvipy Did you backport this?

luzfcb added a commit to labcodes/celery that referenced this pull request Nov 23, 2021
emmettbutler added a commit to DataDog/dd-trace-py that referenced this pull request Mar 22, 2023
The issue referenced was
[resolved](celery/celery#6374), but it actually
does not apply to the bit of code it's pointing to.

Fixes #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.
IlyaMichlin pushed a commit to IlyaMichlin/dd-trace-py that referenced this pull request Mar 30, 2023
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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants