w3c / baggage

Propagation format for distributed context: Baggage
https://w3c.github.io/baggage/
Other
46 stars 18 forks source link

Clarify how compliant implementations should handle invalid baggage entries #137

Open lachmatt opened 1 month ago

lachmatt commented 1 month ago

There is inconsistency related to how invalid baggage entries are handled by some existing implementations (e.g java implementation ignores invalid entries on both inject/extract, and propagate valid ones; go implementation ignores all the propagated baggage entries on extract if any of them is invalid).

There is a section in the spec that states:

If a system determines that the value of a baggage entry is not in the format defined in this specification, it MAY remove that entry before propagating the baggage header as part of outgoing requests.

Baggage entries have key, value, and metadata. Does "value" in the context quoted above mean baggage entry value specifically (in that case, what if key or metadata are invalid), or whole baggage entry?

xiang17 commented 1 month ago

The quoted line specifies that "it MAY remove that entry" rather than all the propagated baggage entries.

I'm not familiar with the go library. The go implementation link in your description points to Parse, which looks like during inject. Can you help me point out where is the code that ignores all the propagated baggage entries?

lachmatt commented 1 month ago

I'm not familiar with the go library. The go implementation link in your description points to Parse, which looks like during inject. Can you help me point out where is the code that ignores all the propagated baggage entries?

It is my understanding of the go implementation that Parse is used in Extract part. If Parse returns an error (if it fails to parse any of the members) then all the propagated baggage entries are ignored.