Skip to content

Release/0.6.0 - #24

Merged
Pythondeveloper6 merged 38 commits into
mainfrom
release/0.6.0
Dec 4, 2026
Merged

Pythondeveloper6 merged 38 commits into
mainfrom
release/0.6.0

Conversation

@Pythondeveloper6

Copy link
Copy Markdown
Collaborator

What and why

Checklist

  • Tests added or updated (sync and async paths; use fake_clock rather than real sleeps)
  • uv run pytest passes
  • uv run ruff check src tests and uv run ruff format --check src tests pass
  • uv run mypy passes
  • Public functions have Google-style docstrings
  • CHANGELOG.md updated under Unreleased

…ore outages

- Circuit breaker and shared bulkhead release log store errors after a call
  finished and return its result instead of raising.
- Redis cache stores build keys and run the codec outside the backend monitor:
  unencodable keys raise TypeError, undecodable entries are misses
  (cache.rejected reason "decode"), dumps errors propagate.
- Key encoder accepts subclasses of the plain types, named tuples (class
  tagged), and a __cache_key__() hook; -0.0 and 0.0 share a key.
  Adds python_wrap._runtime.cache_key_of.
- Half-open rejections carry a positive retry_after (local and shared).
- Hinted waits get up to 10% jitter and a 50 ms floor for a zero hint.
- Prefork: watches restart in forked children, SQL lock backends rebind after
  fork, plain locks on shared-state paths become fork-safe.
- Live Redis tests for each Lua script and the backend recovery events; a
  requests adapter test module; a release-metadata check script and tests.
Feature pages for caching, circuit breakers, retry, HTTP clients and shared
limits describe the new key rules, failure modes and hint jitter. Examples
and cookbook assertions that depended on exact retry waits now use ranges.
Changelog and README gain the 0.4.1 entries and the stable-surface section.
- A bare retry or retrying() with no delay, backoff or jitter emits one
  FutureWarning per process that names the 0.5.0 defaults.
- Doctor PW024 (no backoff or jitter on a retry) runs without --multiprocess.
- Doctor PW025 (warning): a retry on every Exception with no retry_if or
  retry_if_result.
…PW026

- configure(cache_codec="json") and configure(cache_codec=("signed-pickle",
  ENV_NAME)) select the shared-cache codec; the secret is read from the named
  environment variable when each store is built. Adds stores.resolve_codec.
- The implicit plain-pickle warning on RedisStore and AsyncRedisStore is a
  FutureWarning that names the 0.5.0 default change.
- Doctor PW026 (warning) for a memoized function on a shared store that uses
  plain pickle.
retry, retrying, retry_countdown, retry_task and HttpRetryPolicy accept
hint_jitter (default 0.1) and min_delay (default 0.0). Hinted waits from
delay_from, Retry-After and breaker retry_after are jittered by default, so
exact hinted waits need hint_jitter=0.
- The request id and inherited deadline are read from the request attributes
  or its headers mapping, so both Celery header layouts are found.
- A task published from another app's sender no longer gets this
  integration's headers. The task log context carries request_id_inherited.
- Real-worker tests run an embedded Celery worker on an in-memory broker.
- Documents the clock-skew limit of inherit_deadline.
- All plain threading locks and Conditions in src/python_wrap (outside _fork.py)
  use ForkSafeLock/ForkSafeRLock; a test scans for plain locks with no allow-list.
- scripts/prefork_check.py starts a watch in the parent, forks two workers and
  checks each applies a changed policy file within two poll intervals; CI runs it.
- Documents watch and SQL lock behaviour under prefork servers.
- mount_policy tests: per-host breakers, default timeouts, 429 Retry-After
  pauses, request-id and deadline propagation.
- Live Redis tests for the quota script, backend-recovered events and the
  requests adapter run in the backend-integration CI job.
- The quota Lua script is a module constant (no behaviour change).
Keyed rate windows, keyed LLM budget scopes and the keyed LLM response cache
hash their key with stable_digest, so a set, frozenset or dict key no longer
splits into several windows across processes. Their store keys change once on
upgrade; for one period a keyed limit can admit up to twice its rate while old
and new processes overlap. Unkeyed limits keep their store keys. Name-only call
sites use name_digest, which keeps the previous digest output.
- A closed or open state of a shared breaker is answered inline from the
  process cache; the async shared breaker creates no task per call.
- The open state is cached until its recovery time, for at most
  min(wait, state_ttl * 5) seconds. Rejections answered locally are not added
  to the store's total_rejected.
- Half-open is never cached; reset and force_open always reach the store.
- Performance page updated from a benchmark run on CPython 3.14.7.
- All Redis Lua scripts run through python_wrap._scripts.Script: EVALSHA first,
  reload on NOSCRIPT. Script text and key formats are unchanged.
- RedisRetryBudget batches deposits (flush_every=1000 or flush_interval=1.0 s).
  Withdrawals and totals flush first. A deposit never raises; a store error adds
  its count to the local budget.
- The budget script accepts an optional deposit count; four-argument callers
  keep working.
… bulkheads

- on_backend_error on RedisStore, AsyncRedisStore, the token windows, Lease
  and Bulkhead. Caches default to allow, token windows to local, and the
  others to raise; the defaults are unchanged.
- configure(backend_errors=) applies to caches and token windows built without
  an explicit mode. The project default is cached instead of copied per call.
- Caches and token windows emit backend.error on store errors; memoize with
  lock= computes when the lock store is down.
- A store error while a shared bulkhead is queued no longer escapes in every
  mode. Quota.remaining and Quota.reset respect the backend mode.
- Repeated store failures log one warning per interval, not one per call.
- fail_open= is deprecated (DeprecationWarning, removed in 0.6.0).
- One daemon renewal thread per process serves every shared lease, so a call
  no longer starts a thread. A renewal that starts after the TTL marks the lease
  lost. Degraded leases are never queued for renewal.
- Waiting for a lease backs off its polls (50 ms doubling to 0.5 s, capped at
  ttl/3 and the time left, up to 20% jitter) instead of polling every 50 ms.
- The renewal thread restarts in a forked child.
- idempotent_task(scope="delivery" | "arguments") keys on the task id or the
  arguments; key= still overrides both. Without scope or key the arguments key
  is kept and a FutureWarning names the 0.5.0 default change.
- A delivery that finds its task running is re-queued up to requeue_limit
  times, counted in the x_pw_requeues header; the task's own max_retries is
  not used up.
- The lease default drops from 600 s to 60 s.
- PW023 flags an idempotent lease longer than the visibility timeout.
- Example: examples/celery_idempotent_tasks.py.
@Pythondeveloper6
Pythondeveloper6 merged commit 7724474 into main Dec 4, 2026
53 checks passed
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