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

RetryingHttpClient.executeAsync skips retry handling when delegate throws synchronously

Aperta
#888 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

@sylvesterkaczmarek ci sta già lavorando.

Dal 18/8/2026.

  • #891 di @sylvesterkaczmarek — aperta

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
78/100
Tipo di issue
Bug
Chiarezza
Specificata chiaramente
Stato di attività
Tranquilla
Stack tecnologico
kotlin
Ambito
api, testing

Direzione di ricerca

Inizia da RetryingHttpClient.executeAsync() e ispeziona il percorso di retry esistente di handleAsync attorno alla chiamata al delegate. Esegui i test correnti relativi ai retry, quindi aggiungi una copertura di regressione per i fallimenti sincroni ritentabili e non ritentabili e verifica che gli header del conteggio dei retry rimangano corretti; il lavoro è completato quando i fallimenti sincroni seguono la stessa policy dei future eccezionali.

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

Descrizione

Description

RetryingHttpClient.executeAsync() calls the delegate before it has a CompletableFuture to attach its retry policy to:

val responseFuture = httpClient.executeAsync(requestWithRetryCount, requestOptions)

A custom HttpClient implementation is allowed by the SDK surface and can throw synchronously from executeAsync() instead of returning an exceptionally completed future.

When that happens, the exception escapes RetryingHttpClient.executeAsync() immediately. The existing handleAsync branch never sees it, so even retryable synchronous failures such as IOException, OpenAIIoException, or OpenAIRetryableException bypass the configured retry policy.

Expected behavior

Synchronous failures from the async delegate should enter the same retry decision path as exceptionally completed futures. Retryable failures should retry up to maxRetries; non-retryable failures should surface through the returned future.

Suggested fix

Wrap the delegate call and convert a synchronous throwable into an exceptionally completed CompletableFuture<HttpResponse> before applying the existing retry handler.

Add regression coverage for:

  • a synchronous OpenAIRetryableException followed by a successful async response;
  • a synchronous non-retryable exception completing the returned future exceptionally without a retry;
  • retry-count headers remaining correct across the synchronous-failure retry.
Lingua principale
Kotlin
Stelle
1.5k
Fork
266
Merge medio
10h 11m
PR unite (30g)
141

Preparare l'ambiente

Apri in Codespaces

Avvia il container di sviluppo del progetto nel browser, con il tuo account GitHub.

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 openai/openai-java

Tutte le issue di openai/openai-java

Issue simili

Altre issue su Kotlin

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.