Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

RetryingHttpClient.executeAsync skips retry handling when delegate throws synchronously

Đang mở
#888 0 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 1 ngày

@sylvesterkaczmarek đang làm issue này rồi.

Từ ngày 18/8/2026.

  • #891 của @sylvesterkaczmarek — đang mở

Đánh giá

Độ khó
3/5
Thời gian dự kiến
1-2 ngày
Mức phù hợp với người mới
78/100
Loại issue
Lỗi
Độ rõ ràng
Đặc tả rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
kotlin
Lĩnh vực
api, testing

Hướng nghiên cứu

Bắt đầu từ RetryingHttpClient.executeAsync() và kiểm tra đường dẫn retry hiện có của handleAsync xung quanh lệnh gọi delegate. Chạy các bài kiểm thử hiện tại liên quan đến retry, sau đó bổ sung coverage hồi quy cho các lỗi đồng bộ có thể retry và không thể retry, đồng thời xác minh rằng các header về số lần retry vẫn chính xác; công việc được hoàn tất khi các lỗi đồng bộ tuân theo cùng chính sách với các future bất thường.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

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.
Ngôn ngữ chính
Kotlin
Star
1.5k
Fork
266
Merge trung bình
10 giờ 11 phút
Pull request đã merge (30 ngày)
141

Chuẩn bị môi trường

Mở trong Codespaces

Khởi chạy dev container của dự án ngay trên trình duyệt, bằng tài khoản GitHub của bạn.

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. 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.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của openai/openai-java

Tất cả issue của openai/openai-java

Issue tương tự

Thêm issue về Kotlin

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.