Skip to content

Propagate async cancellation through retries#766

Open
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/retrying-http-client-async-cancel
Open

Propagate async cancellation through retries#766
fallintoplace wants to merge 1 commit into
openai:mainfrom
fallintoplace:fix/retrying-http-client-async-cancel

Conversation

@fallintoplace

Copy link
Copy Markdown

Summary

  • preserve caller cancellation when async requests are wrapped by RetryingHttpClient
  • cancel the current HTTP attempt or pending retry sleep when the outer future is cancelled
  • add regression coverage for cancellation during an in-flight attempt and during retry backoff

Testing

  • ./gradlew :openai-java-core:test --tests com.openai.core.http.RetryingHttpClientTest
  • ./gradlew :openai-java-client-okhttp:test --tests com.openai.client.okhttp.OkHttpClientTest :openai-java-core:test --tests com.openai.core.http.RetryingHttpClientTest
  • SKIP_MOCK_TESTS=true ./gradlew :openai-java-core:test :openai-java-client-okhttp:test

@fallintoplace fallintoplace requested a review from a team as a code owner June 27, 2026 21:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant