WorkloadIdentityHttpClient can leak its delegate when auth cleanup throws
Chưa có ai nhận issue này.
Đá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
- 76/100
Hướng nghiên cứu
Bắt đầu bằng cách tìm WorkloadIdentityHttpClient.close() và so sánh luồng dọn dẹp của nó với mẫu AuthenticatingHttpClient tương ứng. Thêm kiểm thử hồi quy cho lỗi xác thực kèm dọn dẹp delegate, lỗi từ cả hai tài nguyên có suppression và dọn dẹp thông thường; hoàn tất khi cả hai tài nguyên đều được thử xử lý và lỗi đầu tiên được giữ lại.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Description
WorkloadIdentityHttpClient.close() currently closes workloadIdentityAuth before closing its delegate:
override fun close() {
workloadIdentityAuth?.close()
delegate.close()
}
If the configured workload-identity provider throws from close(), execution never reaches delegate.close().
This differs from the sibling AuthenticatingHttpClient, which deliberately attempts both cleanup operations and preserves the first failure while suppressing a second one.
Impact
A custom SubjectTokenProvider may implement AutoCloseable and fail during cleanup. In that case the underlying HTTP client can remain open, retaining transports, connection pools, executors, or other resources.
Expected behavior
Closing the wrapper should always attempt to close both owned resources. If both fail, the first failure should be propagated and the second retained as a suppressed exception.
Suggested fix
Use the same failure-preserving cleanup pattern already used by AuthenticatingHttpClient, with workload-identity cleanup attempted first and delegate cleanup guaranteed afterward.
Add regression coverage for:
- auth cleanup fails, delegate still closes;
- both cleanup operations fail, delegate failure is suppressed on the auth failure;
- normal close still closes both resources.
- Ngôn ngữ chính
- Kotlin
- Star
- 1.5k
- Fork
- 264
- Merge trung bình
- 13 giờ 51 phút
- Pull request đã merge (30 ngày)
- 113
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 openai/openai-java
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
openai/openai-java#886 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
openai/openai-java#802 · 2 bình luận · 3 reaction ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openai/openai-java#755 · 1 bình luận ·
-
bug sdk
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 72/100
openai/openai-java#652 · 2 bình luận ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 74/100
openai/openai-java#973 ·
Tất cả issue của openai/openai-java
Issue tương tự
-
Flaky: a relaunched catch-up replay can still report catching up right after its marker is written Đang mởbug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
johanhaleby/occurrent#1134 ·
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 88/100
Blockstream/green_android#313 ·
-
autoteam community team/use
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
android: AlbumArtistDetailViewModel keeps groupKeys of albums that disappeared in expandedAlbums Đang mởtask
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 90/100
aaif-goose/goose#12496 ·