Commit 662ff4c
authored
fix: clear stale baggage items before extracting new ones from carrier (#7507)
When _extractBaggageItems extracts baggage from a carrier, it previously
accumulated new items on top of existing baggage in async local storage,
causing stale baggage from previous requests to leak into subsequent
traces and outbound SQS messages.
Moves the baggage cleanup to the very first line of _extractBaggageItems()
so stale baggage is cleared even when the current carrier has no baggage
header or baggage is not in the extraction propagation styles.
Added test covering the no-baggage-header scenario.1 parent b9ea9c5 commit 662ff4c
File tree
2 files changed
+32
-0
lines changed- packages/dd-trace
- src/opentracing/propagation
- test/opentracing/propagation
2 files changed
+32
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
667 | 667 | | |
668 | 668 | | |
669 | 669 | | |
| 670 | + | |
670 | 671 | | |
671 | 672 | | |
672 | 673 | | |
| |||
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
750 | 750 | | |
751 | 751 | | |
752 | 752 | | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
| 759 | + | |
| 760 | + | |
| 761 | + | |
| 762 | + | |
| 763 | + | |
| 764 | + | |
| 765 | + | |
| 766 | + | |
| 767 | + | |
| 768 | + | |
| 769 | + | |
| 770 | + | |
| 771 | + | |
| 772 | + | |
| 773 | + | |
| 774 | + | |
| 775 | + | |
| 776 | + | |
| 777 | + | |
| 778 | + | |
| 779 | + | |
| 780 | + | |
| 781 | + | |
| 782 | + | |
| 783 | + | |
753 | 784 | | |
754 | 785 | | |
755 | 786 | | |
| |||
0 commit comments