Repository navigation
chore: require circuit-breaker-box>=0.3.9 for non-blocking retries - #5
Merged
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Require
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-boxbefore 0.3.9 drove its retry loops with the synchronoustenacity.Retrying, which sleeps viatime.sleep(). That blocks the whole event loop for the length of each retry wait, not just the calling task.base-clientexposes the affectedRetrierdirectly throughBaseClient.retrier, so any client configured with a positive wait strategy inherited the stall, as did anyone usingCircuitBreakerRedis.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 forCircuitBreakerRedis.increment_failures_count/is_host_available.The upper bound keeps the pin inside the current minor, since
Retrieris re-exported as part of this package's surface.No code change needed
base_clientonly touches the publicRetrierAPI, which 0.3.9 left untouched — same name, same signature, noAsyncRetrierintroduced, and attempt counts, retry predicates,reraise, callbacks and circuit breaker interaction order all preserved. The only difference is thatretry()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 --checkandruff checkall clean.Second commit
chore: ignore CPY001is separable from the bump and touches onlypyproject.toml.ruffis unpinned andjust installrunsuv lock --upgrade, so CI resolves the newestruffon every run; a release since the last green build onmain(August 2025) enabledCPY001underselect = ["ALL"], and it reports all 13 files in the project.This is unrelated to the bump — checking out an untouched
mainand runningruff checkreproduces the same 13 errors, somainfails lint today as well. Same fix as circuit-breaker-box#10. Drop that commit if you would rather handle the lint drift separately.