Better catching of httpx errors and retrying them

This commit is contained in:
Jake Poznanski 2024-11-21 23:35:42 +00:00
parent d6a00135a7
commit f8dcdf625a
2 changed files with 2 additions and 2 deletions

View File

@ -184,7 +184,7 @@ async def process_page(args, session: httpx.AsyncClient, worker_id: int, pdf_s3_
output_tokens=base_response_data["usage"].get("completion_tokens", 0),
is_fallback=False,
)
except (httpx.TimeoutException, httpx.ConnectError, asyncio.TimeoutError) as e:
except (httpx.TransportError, asyncio.TimeoutError) as e:
logger.warning(f"Client error on attempt {attempt} for {pdf_s3_path}-{page_num}: {e}")
# Now we want to do exponential backoff, and not count this as an actual page retry

View File

@ -2,7 +2,7 @@ _MAJOR = "0"
_MINOR = "1"
# On main and in a nightly release the patch should be one ahead of the last
# released build.
_PATCH = "41"
_PATCH = "42"
# This is mainly for nightly builds which have the suffix ".dev$DATE". See
# https://semver.org/#is-v123-a-semantic-version for the semantics.
_SUFFIX = ""