Skip to content

ENG-12238: document Reflex app scaling and recovery - #7570

Merged
Kastier1 merged 6 commits into
mainfrom
codex/eng-12238-scaling-docs
Oct 21, 2026
Merged

Kastier1 merged 6 commits into
mainfrom
codex/eng-12238-scaling-docs

Conversation

@Kastier1

@Kastier1 Kastier1 commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

This adds the scaling guide to the existing documentation, covering replaceable backends, durable report jobs, regional session state, primary/read-replica routing, Redis recovery, and OpenTelemetry compatibility.

The architecture and job-lifecycle diagrams distinguish request, replication, and queue traffic. Redis guidance uses an ordinary provider-managed failover endpoint. The runnable Reflex state/UI example preserves retry keys, reads authorized status, and rejects stale responses. Report selection is tied to owner/session identity, and only an explicit New report action creates a key; Submit with no selected key recovers an existing job. Database/outbox/broker durability remains an explicit application contract.

The guide separates persisted-state and frontend compatibility hashes, links to the canonical self-hosting migration warning, and gives the dependency constraints for reflex-otel==0.2.0. Full-size diagram links work with both an empty frontend path and /docs.

Validation:

  • Docs CI passed on this head's merge ref: 703 passed, 69 skipped, 6 xfailed, including all 29 extracted-example cases. The complete local locked Python 3.12 suite also passed with default plugins: 698 passed, 65 skipped, 6 xfailed. These exercise frontend compilation, retries/recovery, stale responses, account switches, same-owner relogin, logout cleanup, explicit new requests, and execution after other documentation examples. The harness uses asyncio.run, so no async pytest plugin is needed.
  • State/schema checks: 13 passed.
  • Browser preview at 1440px and 390px: full-size SVG links return the expected assets; code and diagrams stay within the page width.
  • Built wheel, sdist, and isolated installed guide match the source bytes. 72 focused MCP/catalog tests pass against the candidate bundle, using model doubles rather than live relevance calls. Nine offline queries, including Redis failover and Redis Sentinel, run singly and in batches of five/four; they verify query forwarding and full-body hydration, not live relevance.
  • Explicit type checking of the example tests passes. Full local pre-commit reproduces six unchanged macOS CPU-affinity errors; all other hooks and the generated-stub check pass. All 12 required checks passed on head 718849767258323166e9a2edc68d233e04504d60, including Linux pre-commit.
  • Production docs integration CI passed on this head with Python 3.11 and 3.12: production client/SSR builds, /hosting/scaling prerendering, 23 sitemap/SEO checks, and five frontend regressions per job.

MCP rollout sequencing: Flexgen PR #6287 is already merged and still pins the earlier e29bd80cd bundle. The fixture follow-up remains local. After the source revision is approved, update the real dependency pin and lock together with that fixture, reinstall from the lock, and rerun bundled-guide retrieval checks. Publishing the website alone does not refresh MCP.

ENG-12238 · Existing draft

@Kastier1
Kastier1 requested review from a team and Alek99 as code owners October 14, 2026 19:32
@linear-code

linear-code Bot commented Oct 14, 2026

Copy link
Copy Markdown

ENG-12238

@cubic-dev-ai cubic-dev-ai Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No issues found across 6 files

View guided diff | Turn on auto-fix | Re-trigger cubic

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review Summary

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

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-10-14T19:36:18.951791Z 324d88d 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.

@greptile-apps

greptile-apps Bot commented Oct 14, 2026 •

Copy link
Copy Markdown
Contributor

RetriggerView in GreptileConfidence Score: 5/5

[Low impact] The PR appears safe to merge; no actionable new issues were found.

Summary

Adds a scaling guide covering replaceable backends, durable report jobs, regional state, database routing, Redis recovery, and telemetry.

  • The scaling guide shows how backends and data stores work together.
  • Report jobs can finish and be recovered after their backend goes away.
  • MCP docs explain how assistants search and fetch bundled knowledge.

Reviews (6) · Last reviewed commit: "Merge branch 'main' into codex/eng-12238..." · Reviewed by Greptile

@codspeed

codspeed Bot commented Oct 14, 2026 •

Copy link
Copy Markdown

Merging this PR will not alter performance

⚠️ 17 benchmarks spent significant time in system calls

System calls cannot be consistently instrumented, so they are not included in the measure, which understates the real cost. Please switch to the Walltime instrument to accurately measure system calls.

Measurement and system calls

✅ 148 untouched benchmarks


Comparing codex/eng-12238-scaling-docs (f63c762) with main (4be8b4d)

Open in CodSpeed

Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
@masenf masenf added the documentation Improvements or additions to documentation label Oct 14, 2026
@masenf masenf added the on deck PRs lined up to review / merge next label Oct 16, 2026

@FarhanAliRaza FarhanAliRaza left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I checked out the PR head (e29bd80) and ran the docs dev server with the changed pages: scaling, self-hosting, performance and execution, and MCP overview. I checked the scaling page in Chrome at desktop width, at narrow width, and in dark mode. I tested keyboard scroll on the diagram regions, every link on the page, and the console.

I compared the technical claims with the code: the Redis URL handling in prerequisites.py, Granian selection and GRANIAN_WORKERS in exec.py, the state schema hashes in state.py, the metric names in reflex_base/otel.py, and the reflex-otel manifests at their release tags. These claims match the code.

I also checked the earlier review comments against the new commit. The inline comments are the remaining requested changes.

Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md Outdated
Comment thread docs/hosting/scaling.md
Comment thread docs/hosting/scaling.md

@cubic-dev-ai cubic-dev-ai Bot left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All reported issues were addressed across 2 files (changes from recent commits).

Tip: Review your code locally with the cubic CLI to iterate faster.

View guided diff | Turn on auto-fix | Re-trigger cubic

Comment thread docs/hosting/scaling.md
@Kastier1
Kastier1 merged commit eb0cd67 into main Oct 21, 2026
179 of 181 checks passed
@Kastier1
Kastier1 deleted the codex/eng-12238-scaling-docs branch October 21, 2026 18:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation on deck PRs lined up to review / merge next

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants