fix(celery): coerce non-string values to str in CeleryGetter.get()#4434
Closed
alliasgher wants to merge 2 commits intoopen-telemetry:mainfrom
Closed
fix(celery): coerce non-string values to str in CeleryGetter.get()#4434alliasgher wants to merge 2 commits intoopen-telemetry:mainfrom
alliasgher wants to merge 2 commits intoopen-telemetry:mainfrom
Conversation
Celery's Context object copies all message properties as instance attrs, including numeric fields like timelimit. CeleryGetter.get() wrapped these in a tuple but didn't convert to str, causing TextMapPropagators to crash with "TypeError: expected string or bytes-like object, got 'int'" when calling re.split() in TraceState.from_header(). Coerce non-string, non-iterable values to str before wrapping in a tuple. Fixes open-telemetry#4359 Signed-off-by: alliasgher <alliasgher123@gmail.com>
ee15d7b to
f9ee765
Compare
Signed-off-by: Ali <alliasgher123@gmail.com>
Member
|
This is a duplicate of #4360. Closing this one in favour of that one as it's already approved. Thanks @alliasgher. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
CeleryGetter.get()previously returned header values verbatim. When a downstream library sets a non-string value in the header map (e.g. an int), propagator machinery downstream fails because it expectsstr. Coerce non-string values withstr()so context propagation is robust.Fixes #4341
Type of change
Checklist
Unreleased / Fixed