W3CBaggagePropagator drops a list-member over 4096 bytes that W3C Baggage requires it to propagate
メンテナーはふだん 2 日以内に返信
評価
- 難易度
- 2/5
- 見積もり時間
- 1〜3時間
- 初心者へのやさしさ
- 70/100
- issue の種類
- バグ
- 明瞭さ
- 明確に書かれている
- 活発さ
- 活発
- 技術スタック
- python
調査の方向性
メンバーごとの上限は定数 _MAX_PAIR_LENGTH で、W3CBaggagePropagator の extract パスと inject パスの両方でチェックされます。まずこの定数がどこで使われているか、そして各パスがどのようにメンバーを破棄するかを読んでください。仕様の解釈が未解決の論点なので、編集する前にメンテナーと提案の方向性を確認してください。tests/propagators/test_w3cbaggagepropagator.py に 4100 バイトの extract と inject のテストを追加し、180 メンバーと 8192 バイトの上限が引き続き成り立つことを確認してください。
索引モデルが issue の本文から書いたものです。
説明
Describe your environment
- OS: macOS 26.7.2
- Python version: Python 3.15.2
- SDK version:
mainat66ec883 - API version:
mainat66ec883
What happened?
W3CBaggagePropagator drops any list-member longer than 4096 bytes (_MAX_PAIR_LENGTH), on extract and on inject, even when the whole header is far below 8192 bytes. W3C Baggage has no per-member limit. Its Limits section says a platform MUST propagate all list-members while the baggage-string has 64 members or fewer and is 8192 bytes or smaller, and only past that MAY it drop some.
Steps to Reproduce
from opentelemetry import baggage
from opentelemetry.baggage.propagation import W3CBaggagePropagator
p = W3CBaggagePropagator()
header = "session=" + "a" * 4092 + ",user=alice" # 2 members, 4112 bytes
print("extract:", {k: len(v) for k, v in baggage.get_all(p.extract({"baggage": header})).items()})
carrier = {}
p.inject(carrier, baggage.set_baggage("session", "a" * 4092)) # 1 member, 4100 bytes
print("inject:", carrier)
Expected Result
extract: {'session': 4092, 'user': 5}
inject: {'baggage': 'session=aaaa...'}
Actual Result
$ python bag.py
Baggage entry with key `session` exceeded the maximum number of bytes per list-member with length 4100
Baggage entry with key `session` exceeded the maximum number of bytes per list-member with length 4100
extract: {'user': 5}
inject: {}
Additional context
With _MAX_PAIR_LENGTH = 8192 the same script prints the expected result, and tests/propagators/test_w3cbaggagepropagator.py still passes (34 passed), because its tests derive their sizes from the constant. The 4096 comes from the 2020 Working Draft ("Maximum number of bytes per a single name-value pair: 4096"), which #5163 followed on inject; the current text dropped it, and #5823 kept it. opentelemetry-go has no per-member limit, and its larger members vanish at the first Python hop.
My pick is to remove the per-member check and keep the 180-member and 8192-byte limits. Shall I send that as a pull request with an extract and an inject test at 4100 bytes?
Would you like to implement a fix?
Yes
- 主要言語
- Python
- スター
- 2.7k
- フォーク
- 1.1k
- 平均マージ
- 4日 13分
- マージ済み PR(30日)
- 38
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートあり
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
open-telemetry/opentelemetry-python のほかの issue
-
opentelemetry-configuration: OTLP HTTP exporter does not validate TLS files exist at startup対応中かも @Dotify71 が 5 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open-telemetry/opentelemetry-python#5928 ·
メンテナーはふだん 2 日以内に返信
-
otel.sdk.processor.{span,log}.queue.capacity uses synchronous UpDownCounter recorded once in __init__再び着手できるかも このイシューのプルリクエストはマージされずにクローズされました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
open-telemetry/opentelemetry-python#5891 ·
メンテナーはふだん 2 日以内に返信
-
Prometheus map_unit incorrectly normalizes percent ratio units such as %/s対応中かも @knowprasad が 10 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 84/100
open-telemetry/opentelemetry-python#5875 · コメント 1 件 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
OTLP HTTP exporter reports a 3xx response as a successful export, so redirected batches are dropped without any log対応中かも @d4rshnn が 18 日前に担当しました。 オープンbug
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
open-telemetry/opentelemetry-python#5865 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
-
難易度 1/5 1時間未満 初心者へのやさしさ 70/100
open-telemetry/opentelemetry-python#5700 · コメント 1 件 ·
メンテナーはふだん 2 日以内に返信
open-telemetry/opentelemetry-python の issue をすべて見る
似ている issue
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 66/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 75/100
docling-project/docling-pipelines#669 ·
メンテナーはふだん 1 日以内に返信
-
blocked kind/enhancement
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
opendatahub-io/agent-eval-harness#329 · コメント 2 件 · リアクション 1 件 ·
-
cc_wrapper crashes with ValueError on Windows when a path is on another drive対応中かも @TrapsterDK が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 79/100
tweag/rules_haskell#2492 ·
メンテナーはふだん 1 日以内に返信