Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

JdkHttpSender does not close the response body on unsupported Content-Encoding

Aperta Adatta ai principianti
#8,960 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@thswlsqls ci sta già lavorando.

Dal 18/10/2026.

  • #8962 di @thswlsqls — aperta

Valutazione

Difficoltà
2/5
Tempo stimato
1-3 ore
Idoneità per principianti
76/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Attiva
Stack tecnologico
java
Ambito
backend

Direzione di ricerca

Inizia da JdkHttpSender.toHttpResponse() e segui la gestione del corpo della risposta intorno al controllo di Content-Encoding non supportato e a BodyHandlers.ofInputStream(). Confrontala con OkHttpHttpSender.handleResponse(), che secondo l’issue chiude il corpo. Il lavoro è completato quando la codifica non supportata continua a generare UnsupportedContentEncodingException e chiude il corpo della risposta; l’issue non indica un file di test.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

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

  1. Configure an OTLP HTTP exporter with the JDK sender (opentelemetry-exporter-sender-jdk).
  2. Point it at a server or proxy that answers with Content-Encoding: br, ignoring our Accept-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

Lingua principale
Java
Stelle
2.5k
Fork
1k
Merge medio
2g 20h
PR unite (30g)
62

Preparare l'ambiente

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di open-telemetry/opentelemetry-java

Tutte le issue di open-telemetry/opentelemetry-java

Issue simili

Altre issue su Java

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.