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

JdkHttpSender passes CompletionException instead of the original exception to onError

Aperta Adatta ai principianti
#8,961 0 commenti 1 reazione 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 2 giorni

@thswlsqls ci sta già lavorando.

Dal 18/10/2026.

  • #8963 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

Direzione di ricerca

Inizia da JdkHttpSender.java, intorno alle righe 181–190, dove supplyAsync e whenComplete passano l’errore a onError; confronta questo percorso con la gestione esistente di RejectedExecutionException. Controlla in HttpExporterTest il tipo di errore IOException previsto e riproduci il problema usando il mittente JDK con una connessione rifiutata. Il lavoro è completato quando onError riceve l’eccezione di trasporto originale e l’esportatore ne segnala il tipo.

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

Descrizione

Describe the bug
JdkHttpSender.send() passes a CompletionException wrapping an UncheckedIOException wrapping the real IOException to onError, instead of the original exception. HttpExporter then records error.type=java.util.concurrent.CompletionException for every transport failure, and the wrapper becomes the top-level exception in the SEVERE log and the cause of FailedExportException.

Steps to reproduce

  1. Use OtlpHttpSpanExporter with opentelemetry-exporter-sender-jdk and setInternalTelemetryVersion(InternalTelemetryVersion.LATEST).
  2. Point it at an endpoint with no listener (connection refused) and export a span.
  3. Inspect error.type on otel.sdk.exporter.span.exported, or FailedExportException.getCause().

What did you expect to see?
The real exception, e.g. java.net.ConnectException, as with OkHttpHttpSender, which passes the IOException from onFailure to onError. HttpExporterTest also expects error.type=java.io.IOException when the sender reports an IOException.

What did you see instead?
java.util.concurrent.CompletionException. supplyAsync wraps the UncheckedIOException thrown at JdkHttpSender.java line 181 in a CompletionException, and whenComplete (line 185-190) forwards it unchanged. The RejectedExecutionException path in the same method already passes the unwrapped exception.

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 (source build)

Environment
Compiler: Temurin 21
OS: N/A

Additional context
N/A

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

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.