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 lost baggage if more than one #317

Conversation

sofiaguyang
Copy link
Contributor

@sofiaguyang sofiaguyang commented Jul 30, 2023

When adding more than one baggage entry, only the last value is kept.

See the modified test which adds KEY_2 and VALUE_2. Only KEY_2 is kept and KEY_1 entry disappears. The original implem always creates a new Baggage with every createBaggageInScope

This pull request fixes this problem by having the every baggage entry be added on top of the existing baggage map in Context.current().

@marcingrzejszczak
Copy link
Contributor

marcingrzejszczak commented Aug 17, 2023

Thanks for the PR and sorry for the delay (I was on PTO)

@marcingrzejszczak marcingrzejszczak merged commit 42c126d into micrometer-metrics:main Aug 17, 2023
5 checks passed
marcingrzejszczak pushed a commit that referenced this pull request Aug 17, 2023
* Modify test to add another baggage in scope and assert presence

* Fix such that adding entry respect existing baggage from Context.current()
@marcingrzejszczak
Copy link
Contributor

Back-ported to 1.1.x 217284d

@marcingrzejszczak marcingrzejszczak added this to the 1.1.5 milestone Aug 17, 2023
@marcingrzejszczak marcingrzejszczak added the bug A general bug label Aug 17, 2023
marcingrzejszczak added a commit that referenced this pull request Aug 18, 2023
@marcingrzejszczak
Copy link
Contributor

Backported to 1.0.x a8f0d06

@marcingrzejszczak marcingrzejszczak modified the milestones: 1.1.5, 1.0.10 Aug 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug A general bug
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants