Skip to content

chore: require circuit-breaker-box>=0.3.9 for non-blocking retries - #5

Merged
lesnik512 merged 2 commits into
mainfrom
chore/require-circuit-breaker-box-0.3.9
Sep 6, 2026
Merged

lesnik512 merged 2 commits into
mainfrom
chore/require-circuit-breaker-box-0.3.9

Conversation

@lesnik512

Copy link
Copy Markdown
Member

What

Require circuit-breaker-box>=0.3.9,<0.4.

-    "circuit-breaker-box",
+    "circuit-breaker-box>=0.3.9,<0.4",

Why

The dependency was previously unconstrained, so a resolver was free to pick any version — including the releases that stall the event loop.

Every circuit-breaker-box before 0.3.9 drove its retry loops with the synchronous tenacity.Retrying, which sleeps via time.sleep(). That blocks the whole event loop for the length of each retry wait, not just the calling task. base-client exposes the affected Retrier directly through BaseClient.retrier, so any client configured with a positive wait strategy inherited the stall, as did anyone using CircuitBreakerRedis.

0.3.9 fixes all three call sites — community-of-python/circuit-breaker-box#10 for Retrier.retry() and community-of-python/circuit-breaker-box#11 for CircuitBreakerRedis.increment_failures_count / is_host_available.

The upper bound keeps the pin inside the current minor, since Retrier is re-exported as part of this package's surface.

No code change needed

base_client only touches the public Retrier API, which 0.3.9 left untouched — same name, same signature, no AsyncRetrier introduced, and attempt counts, retry predicates, reraise, callbacks and circuit breaker interaction order all preserved. The only difference is that retry() now yields during its waits instead of blocking.

Verification

Resolved and tested against the real 0.3.9 from PyPI, confirming the installed artifact carries all three fixes rather than a locally built stand-in.

pytest (62 passed, 100% coverage), mypy --strict, ruff format --check and ruff check all clean.

Second commit

chore: ignore CPY001 is separable from the bump and touches only pyproject.toml. ruff is unpinned and just install runs uv lock --upgrade, so CI resolves the newest ruff on every run; a release since the last green build on main (August 2025) enabled CPY001 under select = ["ALL"], and it reports all 13 files in the project.

This is unrelated to the bump — checking out an untouched main and running ruff check reproduces the same 13 errors, so main fails lint today as well. Same fix as circuit-breaker-box#10. Drop that commit if you would rather handle the lint drift separately.

circuit-breaker-box releases before 0.3.9 drove Retrier.retry() with the
synchronous tenacity.Retrying, which blocks the event loop for the whole
retry wait. base-client exposes that Retrier through BaseClient.retrier,
so every client configured with a positive wait strategy inherited the
stall.

Pin the lower bound to the release that switched to tenacity.AsyncRetrying
and cap it below the next minor. base-client itself only touches the public
Retrier API, which is unchanged, so no code change is needed here.
ruff is unpinned and `just install` runs `uv lock --upgrade`, so CI resolves
the newest ruff on every run. A ruff release since the last green build on
main enabled CPY001 (flake8-copyright) under `select = ["ALL"]`, and it now
reports all 13 files in the project, none of which have ever carried a
copyright header.

This is unrelated to the dependency bump in this branch: checking out an
untouched main and running `ruff check` reproduces the same 13 errors.
Ignore the rule, as the project already does for eight others, matching
circuit-breaker-box#10.
@lesnik512
lesnik512 merged commit 3c30baa into main Sep 6, 2026
6 checks passed
@lesnik512
lesnik512 deleted the chore/require-circuit-breaker-box-0.3.9 branch September 6, 2026 14:02
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