Repository navigation
Conversation
CompatErrorHook wrapped httpx errors before the retry loop checked them.
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #3204.
client.interactionsnever retrieshttpx.ConnectErroror other transport failures, even though_translate_retry_configsetsretry_connection_errors=True.CompatErrorHook.after_errorruns inside the per-attemptdo()inBaseSDK.do_requestand turns the httpx error intoAPIConnectionError._is_transport_errorin the generatedretries.pydoes not recognize that type, so the retry loop raises it as aPermanentErroron the first attempt.after_errornow returns errors unchanged. Translation happens once, at the public boundary, inwrap_sdk_call/async_wrap_sdk_call, which the bridge methods already call (raw and streaming responses go through_RawResponseAccessorProxy). Callers still getAPIConnectionError/APITimeoutErrorwith the httpx error as__cause__.environments.files.uploadwas the one bridge path that called generated code (self._internal.start_upload, sync and async) withoutwrap_sdk_call. It is wrapped now, so it keeps raisingAPIConnectionError.basesdk.pyandretries.pyare Speakeasy output.HttpRetryOptions(attempts=3)and a transport that always raisesConnectError: 1 attempt before, 4 after, the same as a 503. Sync, async, and the httpx2 client all behave this way._translate_retry_configdefaults to 3 retries whenretry_optionsis unset, so default clients now retry connection errors and timeouts (httpx.TimeoutException) too. Themodelspath already retries these whenHttpRetryOptionsis set (fix(retry): retry on httpx.TimeoutException with HttpRetryOptions #2345, fix: Honor HttpRetryOptions for aiohttp connection errors in async requests #3186).test_httpx_compat.py: the sync and async interactions tests fail onmain(assert 1 > 1), and the upload test fails without the newwrap_sdk_call(rawhttpx.ConnectError).