JdkHttpSender does not close the response body on unsupported Content-Encoding
メンテナーはふだん 2 日以内に返信
関連するプルリクエストがすでにマージされています。
- #8962 @thswlsqls による — マージ済み
評価
調査の方向性
JdkHttpSender.toHttpResponse()から始め、未対応のContent-EncodingのチェックとBodyHandlers.ofInputStream()周辺のレスポンスボディ処理を追ってください。issueがボディを閉じると指摘しているOkHttpHttpSender.handleResponse()と比較してください。未対応のエンコーディングで引き続きUnsupportedContentEncodingExceptionが発生し、レスポンスボディが閉じられれば完了です。issueではテストファイルは指定されていません。
索引モデルが issue の本文から書いたものです。
説明
Describe the bug
When a response has a Content-Encoding other than gzip or identity, JdkHttpSender.toHttpResponse() throws UnsupportedContentEncodingException without closing the response body InputStream.
Steps to reproduce
- Configure an OTLP HTTP exporter with the JDK sender (
opentelemetry-exporter-sender-jdk). - Point it at a server or proxy that answers with
Content-Encoding: br, ignoring ourAccept-Encoding: gzip, identity.
What did you expect to see?
The export fails with Unsupported Content-Encoding: br and the body is closed, as in OkHttpHttpSender.handleResponse(), which runs the same check inside try (ResponseBody body = response.body()).
What did you see instead?
The body is never closed: the throw comes before try (InputStream rawIs = response.body()). BodyHandlers.ofInputStream() requires the caller to read to EOF or call close() to release the exchange, so if part of the body has not arrived yet, the exchange is never cancelled. The check and ofInputStream() both came in #8224.
What version and what artifacts are you using?
Artifacts: opentelemetry-exporter-otlp, opentelemetry-exporter-sender-jdk
Version: main @ b32298a83
How did you reference these artifacts? N/A
Environment
Compiler: Temurin 21
OS: N/A
Additional context
N/A
- 主要言語
- Java
- スター
- 2.5k
- フォーク
- 1k
- 平均マージ
- 2日 23時間
- マージ済み PR(30日)
- 68
環境構築
- Dockerfile・Docker Compose ファイルなし
- プルリクエストのテンプレートなし
- コントリビューションガイドを読む
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- issue 番号を参照したプルリクエストを送ります。
open-telemetry/opentelemetry-java のほかの issue
-
OkHttpGrpcSender no longer logs retry attempts対応中かも @thswlsqls が 1 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
open-telemetry/opentelemetry-java#8966 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
JdkHttpSender passes CompletionException instead of the original exception to onError対応中かも @thswlsqls が 2 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-telemetry/opentelemetry-java#8961 · リアクション 1 件 ·
メンテナーはふだん 2 日以内に返信
-
Fix `otel.sdk.log.created` counting semantics対応中かも @anuraaga が 75 日前に担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
open-telemetry/opentelemetry-java#8688 ·
メンテナーはふだん 2 日以内に返信
-
難易度 3/5 1〜2日 初心者へのやさしさ 20/100
open-telemetry/opentelemetry-java#8971 ·
メンテナーはふだん 2 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 35/100
open-telemetry/opentelemetry-java#8970 ·
メンテナーはふだん 2 日以内に返信
open-telemetry/opentelemetry-java の issue をすべて見る
似ている issue
-
account bug communication lecture
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
メンテナーはふだん 1 日以内に返信
-
難易度 2/5 1〜3時間 初心者へのやさしさ 72/100
-
Consumer progress rows interleave topics with equal queue IDs対応中かも このイシューにリンクされたプルリクエストがオープン中、またはマージ済みです。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 76/100
apache/rocketmq-dashboard#7250 ·
メンテナーはふだん 3 日以内に返信
-
Bug
難易度 2/5 1〜3時間 初心者へのやさしさ 67/100
ignatov/intellij-erlang#1093 ·
-
[Bug] QoS count command ignores the times argument after cd対応中かも @CCCLL が今日担当しました。 オープン
難易度 2/5 1〜3時間 初心者へのやさしさ 82/100
apache/dubbo#16530 · コメント 1 件 ·
メンテナーはふだん 1 日以内に返信