Skip to content

fix(background_tasks): warn about the legacy broker variables only for Redis URLs - #901

Merged
antosubash merged 5 commits into
mainfrom
fix/issue-868-legacy-redis-warning
Nov 10, 2026
Merged

antosubash merged 5 commits into
mainfrom
fix/issue-868-legacy-redis-warning

Conversation

@antosubash

Copy link
Copy Markdown
Owner

Closes #868

Summary

  • warn_on_legacy_redis_vars now warns about SM_BG_TASKS_BROKER_URL / SM_BG_TASKS_RESULT_BACKEND only when the value is a redis:// or rediss:// URL. Those are the only values SM_REDIS_URL can carry: besides Celery's broker and result backend, it feeds redis-py's from_url in the rate limiter, leases and the invalidation transport, which rejects Celery's sentinel:// and redis+socket://.
  • A production host that runs tasks in-process (memory:// + cache+memory://, needed because the localhost broker is refused) no longer logs two deprecation warnings it can't act on. The same goes for AMQP, SQS and rpc://. The check is per variable: a Redis broker beside an rpc:// backend still warns about the broker.
  • The production localhost-broker error and the settings.py docstring now say the per-field variables are deprecated only for a Redis URL. Docs: docs/reference/env-vars.md and docs/framework/invalidation.md. CHANGELOG Fixed entry added.

Verification

  • Not browser-verified (--skip-browser): settings and logging only.
  • Local CI: make lint ✓, make test-js ✓ (900 tests). make test-py gave 8243 passed and 2 failed: httpx.ReadTimeout in tests/integration/test_invalidation_cross_process.py under full-suite load. origin/main fails the same 2 tests the same way locally (8236 passed, 2 failed). The file passes on its own.
  • Review: three passes, each with a Sonnet correctness reviewer and a Sonnet maintainability reviewer. Codex reviewed after pass 1 and on the final diff and found nothing.
  • Verification report: https://claude.ai/artifact/G47p5Uh1pDUgpNYwCTZdKq

Report links are Claude Artifacts and start private; the author can share them from claude.ai/code/artifacts if reviewers need access.

Test plan

  • uv run pytest modules/background_tasks/tests/core/settings/test_background_tasks_redis_url.py
  • CI is green

https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4

…r Redis URLs (#868)

SM_REDIS_URL seeds both the broker and the result backend with one URL, so it
can replace SM_BG_TASKS_BROKER_URL / SM_BG_TASKS_RESULT_BACKEND only when they
hold a Redis URL. In-process (memory:// + cache+memory://), AMQP, SQS and rpc://
values are only expressible through those variables and no longer warn.

Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
SM_REDIS_URL is also read through redis-py from_url (rate limiter, leases,
invalidation transport), which rejects Celery's redis+socket and sentinel
schemes, so only redis/rediss values are told to move to it.

Claude-Session: https://claude.ai/code/session_01M9neheZZEe3sVpDi2S3zT4
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 10, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
🔒 Security Review ✅ Completed 2026-11-10T11:53:39.759664Z d1dffcf PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@cloudflare-workers-and-pages

Copy link
Copy Markdown

Deploying simple-module-python with  Cloudflare Pages  Cloudflare Pages

Latest commit: d1dffcf
Status: ✅  Deploy successful!
Preview URL: https://c820da07.simple-module-python.pages.dev
Branch Preview URL: https://fix-issue-868-legacy-redis-w.simple-module-python.pages.dev

View logs

@antosubash
antosubash merged commit cba4ff1 into main Nov 10, 2026
17 checks passed
@antosubash
antosubash deleted the fix/issue-868-legacy-redis-warning branch November 10, 2026 12:01
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.

background_tasks: SM_REDIS_URL can't replace the deprecated variables for in-process transports

1 participant