Skip to content

Conversation

@BloggerBust
Copy link
Contributor

Description

This PR extends TenacityConfig to allow opt in retries for REST transport level failures (RestTransportError and subclasses), scoped to configurable HTTP methods.

There is no default behavior change:

  • REST transport errors are not retried unless explicitly enabled.
  • Existing retry behavior for HTTP errors, such as 5xx ServiceException, 404 NotFoundException, remains unchanged.

When retry_transport_errors=True, transport errors are retried only for configured HTTP methods. The default method set is ["GET", "DELETE"], reflecting idempotent operations.

Comprehensive unit tests validate default behavior, opt in behavior, and regression safety.

Ref: #2872

Type of change

  • New feature (non-breaking change which adds functionality)
  • Test changes (add, refactor, improve or change a test)

What's Changed

  • Add retry_transport_errors: bool = False to TenacityConfig
  • Add retry_transport_methods: list[str] (default ["GET", "DELETE"]) to TenacityConfig
  • Update retry predicate in tenacity_utils.py to:
    • Retry RestTransportError only when enabled
    • Scope retries to configured HTTP methods
  • Tighten method extraction regex to avoid false matches
  • Add parameterized unit tests covering:
    • Default transport retry behavior (disabled)
    • Opt in behavior for allowed methods
    • Protection for non idempotent methods
    • Regression validation for existing HTTP retry behavior
    • Method extraction logic

@vercel
Copy link

vercel bot commented Feb 12, 2026

@BloggerBust is attempting to deploy a commit to the Hatchet Team on Vercel.

A member of the Team first needs to authorize it.

@BloggerBust BloggerBust force-pushed the feat/tenacity-rest-transport-retry-config branch from 062047e to 357a8cd Compare February 12, 2026 05:38
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