Skip to content

Commit

Permalink
Better catching of httpx errors and retrying them
Browse files Browse the repository at this point in the history
  • Loading branch information
jakep-allenai committed Nov 21, 2024
1 parent d6a0013 commit f8dcdf6
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion pdelfin/beakerpipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion pdelfin/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
_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 = ""
Expand Down

0 comments on commit f8dcdf6

Please sign in to comment.