JdkHttpSender does not close the response body on unsupported Content-Encoding
Maintainer thường phản hồi trong vòng 2 ngày
Một pull request liên quan đã được merge.
- #8962 của @thswlsqls — đã merge
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 76/100
Hướng nghiên cứu
Bắt đầu tại JdkHttpSender.toHttpResponse() và theo dõi cách xử lý phần thân phản hồi quanh bước kiểm tra Content-Encoding không được hỗ trợ và BodyHandlers.ofInputStream(). So sánh với OkHttpHttpSender.handleResponse(), nơi issue nêu rằng phần thân được đóng. Công việc hoàn tất khi mã hóa không được hỗ trợ vẫn gây ra UnsupportedContentEncodingException và đóng phần thân phản hồi; issue không nêu tên tệp kiểm thử.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Java
- Star
- 2.5k
- Fork
- 1k
- Merge trung bình
- 2 ngày 23 giờ
- Pull request đã merge (30 ngày)
- 68
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Không có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của open-telemetry/opentelemetry-java
-
OkHttpGrpcSender no longer logs retry attemptsCó thể đã có người làm @thswlsqls đã nhận 2 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
open-telemetry/opentelemetry-java#8966 · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
JdkHttpSender passes CompletionException instead of the original exception to onErrorCó thể đã có người làm @thswlsqls đã nhận 3 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
open-telemetry/opentelemetry-java#8961 · 1 reaction ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Fix `otel.sdk.log.created` counting semanticsCó thể đã có người làm @anuraaga đã nhận 76 ngày trước. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
open-telemetry/opentelemetry-java#8688 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 25/100
open-telemetry/opentelemetry-java#8972 ·
Maintainer thường phản hồi trong vòng 2 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 35/100
open-telemetry/opentelemetry-java#8970 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 2 ngày
Tất cả issue của open-telemetry/opentelemetry-java
Issue tương tự
-
ChaosEngine: backup-remote doctor row passes while consumer mode hides bot memory from gitCó thể đã có người làm @MohabMohie đã nhận hôm nay. Đang mởagentic
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
ShaftHQ/SHAFT_ENGINE#7263 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug/错误
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
FCL-Team/FoldCraftLauncher#1951 ·
Maintainer thường phản hồi trong vòng 4 ngày
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 68/100
quarkusio/quarkus-agent-mcp#296 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
commons-app/apps-android-commons#7072 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Type: Bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
hypherionmc/sdlink#240 ·