Changelog
Release notes are maintained here.
[Unreleased]
Fixed
- Prometheus hooks now use each metric's declared label schema, filling missing values with empty strings so retry, success, exhaustion, abort, and breaker events reach real Prometheus metrics. Existing counter schemas remain supported without configuration changes. Counter failures no longer suppress retry-delay histogram observations. Both
prometheus_hooksandprometheus_metric_hooksupport explicit label selection; wrappers without label metadata retain legacy tag forwarding unless labels are configured. - Policies now release unfinished circuit-breaker admissions on every exit, including cancellation during
AsyncPolicy.execute()retries, callback interruptions, and escaping retry-processing exceptions. Completion and cancellation are tied to the owning admission so older executions, rejected calls, and preflight aborts cannot resolve another half-open probe. Sync/asynccall()andexecute()preserve cancellation and process-exit exceptions. - HTTPX body snapshots reject mappings with duplicate keys before sending, preventing loss of repeated form fields or uploads. Use lists of form values or lists of upload pairs to preserve repeated names across retries.
- HTTPX sync/async request helpers and client wrappers now snapshot buffered bodies for retries and reject unsupported streams, iterators, and file handles before policy execution or sending. Buffered multipart parts remain supported;
skip_ifretains its single-send bypass. Documented body replay requirements, per-attempt stream creation, and the remaining replay limitations in requests/aiohttp wrappers. - Isolated ordinary exceptions from
on_attempt_startandon_attempt_endacross sync/async execution andcall()/execute(), including policies without retries. Observer failures no longer repeat successful operations, replace operation failures, or affect retry budgets and circuit-breaker outcomes. Cancellation and process-exit exceptions still propagate.
[1.4.2] - 2026-09-24
Version 1.4.1 was tagged with incorrect package metadata and was not published
to PyPI. Its fixes and documentation are included in 1.4.2; the existing
v1.4.1 tag is retained unchanged.
Fixed
- Sync and async retries now stop at the final allowed failed attempt without computing backoff, consuming a retry budget token, emitting a
retryevent, or invoking sleep hooks and handlers. This applies to both exception-based and result-based failures throughcall()andexecute(). - Global attempt exhaustion now reports
MAX_ATTEMPTS_GLOBALinstead of being replaced by budget exhaustion or a sleep handler's defer/abort decision. Existing classification and deadline stop conditions retain precedence.
Changed
- Updated the PyPI publisher to support core metadata 2.5 and added strict Twine metadata validation to CI and release checks.
- Added release consistency gates for tags, package and lockfile versions, changelog entries, and built wheel/sdist metadata. Publishing now fails on existing artifacts and creates the GitHub release only after a successful PyPI upload.
Docs
- Added dedicated migration guides for Tenacity and Backoff, plus performance tuning and troubleshooting guides, linked from the docs index and navigation.
- Clarified attempt limits, timeout behavior, retry budgets, and terminal outcomes, with executable examples checked against the current APIs.
Retry telemetry may contain fewer retry events after this fix: the final failed attempt emits exhaustion without an extra retry event. No public API changes are required to upgrade.
[1.4.0] - 2026-04-21
Added
- New provider-specific contrib integrations for OpenAI and Anthropic via
redress.contrib.openaiandredress.contrib.anthropic. - OpenAI and Anthropic classifier helpers (
openai_classifier,anthropic_classifier) that map SDK exceptions into redressErrorClassvalues and preserve provider retry hints. - OpenAI- and Anthropic-aware backoff helpers (
openai_aware_backoff(...),anthropic_aware_backoff(...)) built on top ofretry_after_or(...). - Optional dependency groups for
openaiandanthropic. - Drift/conformance tests against the installed OpenAI and Anthropic SDK exception hierarchies.
Changed
- CI now installs the OpenAI and Anthropic extras so provider contrib coverage runs in the main test matrix.
- Public landing-page copy now foregrounds the provider contrib modules and current integration surface instead of older extras-first positioning.
[1.3.0] - 2026-03-20
Added
- New contrib integrations for
aiohttp,requests, and Celery. - New observability contrib modules for Prometheus, Datadog, and Sentry.
- Optional dependency groups for
requests,celery,prometheus,datadog, andsentry. - Additional tests across contrib and extras modules, including targeted coverage for
pyodbcandgrpcextras.
Docs
- Repositioned
Policy(retry=Retry(...))as the canonical API in Getting Started and README. - Refreshed design notes and public roadmap to match the shipped unified policy model and current roadmap state.
- Clarified contrib-module stability guidance in the API reference.
- Restructured docs IA around
Core guide,Concepts, andRecipes, with clearer page framing and improved nav hierarchy styling.
[1.2.0] - 2026-02-02
Added
- Optional classifier helpers via extras:
aiohttp,grpc,boto3/botocore,redis,urllib3, andpyodbc. - Shared retry budgets (
Budget) withBUDGET_EXHAUSTEDstop reason/event for backpressure. - Testing utilities under
redress.testing(DeterministicStrategy, instant/no retries, FakePolicy, RecordingPolicy, FakeCircuitBreaker). - Per-attempt timeouts (
attempt_timeout_s) for Retry/AsyncRetry;TimeoutErrordefaults to TRANSIENT. - Injectable sleeper (
SleeperFn) andbefore_sleephooks for sync/async retries. - Adaptive backoff strategy wrapper (
adaptive) for failure-rate-sensitive backoff.
Docs
- Added testing guide, worker/queue recipe, and comparison page.
- Expanded production checklist and budget backpressure guidance.
[1.1.0] - 2026-01-25
Added
- Unified
Policy/Retrycontainers (and async variants) with circuit breaker integration. CircuitBreaker,CircuitState, andCircuitOpenErrorplus breaker events.- Result-based retries via
result_classifierand structured outcomes viaexecute()/RetryOutcome. Classification+BackoffContextfor context-aware strategies, plusretry_after_orandhttp_retry_after_classifier.- Attempt lifecycle hooks (
on_attempt_start,on_attempt_end,AttemptContext) and cooperative abort (abort_if,AbortRetryError). - Sleep handlers (
SleepDecision,SleepFn) to defer retries and surfacenext_sleep_s. EventNameandStopReasonenums for stable observability, plusredress.contrib.otelhooks.- Optional timeline capture on
execute()viaRetryOutcome.timeline.
Changed
per_class_max_attemptsnow allows0to disable retries for a class.- Missing per-class strategy stops retries with
StopReason.NO_STRATEGYinstead of raisingRuntimeError. - The
retrydecorator injects a default strategy only when bothstrategyandstrategiesare omitted.
[1.0.2] - 2026-01-24
Fixed
- Use monotonic time for deadline enforcement to avoid wall-clock jumps.
- Propagate cancellation/system-exit exceptions without retries (CancelledError, KeyboardInterrupt, SystemExit).
- Ignore non-HTTP integer args when coercing status in
http_classifier.
Added
strict_classifierfor classifier logic without name-based heuristics.
Docs
- Clarify classifier precedence and heuristic guidance.
[1.0.1] - 2026-01-23
Fixed
- Preserve original tracebacks when retries stop (permanent failures, caps, deadlines).
Docs
- Move changelog to the repository root.
[1.0.0] - 2025-12-24
Added
- 1.0 release and project rename to
redress.
[0.2.2] - 2025-11-24
Added
- bugfixes and docs updates
[0.2.1] - 2025-11-24
Added
- bugfixes and docs updates
[0.2.0] - 2025-11-23
Added
retrydecorator for wrapping sync and async callables with RetryPolicy/AsyncRetryPolicy.- Decorator usage example script and README updates.
- Usage docs covering decorator-based retries.
[0.1.0] - 2025-11-23
Added
- Initial functional version of
redresswith error classification, RetryPolicy with deadlines/per-class limits/hooks, jitter strategies, and metrics/logging adapters.