Commit 225738e
Add built-in /health and /ready endpoints to the Pro node renderer (#3939)
## Summary
Adds first-class, opt-in liveness/readiness probe endpoints to the Pro
node renderer, per the maintainer-triaged descope on the issue. Closes
#3880.
- `GET /health` (liveness): `200` with a status-only body whenever the
event loop is responsive; intentionally checks no dependencies.
- `GET /ready` (readiness): `503` (`{"status":"waiting_for_bundle"}`)
until the answering worker is online **and** has at least one server
bundle compiled into its VM pool, then `200`.
- Default **off**; enabled via the new `enableHealthEndpoints` config
option or `RENDERER_ENABLE_HEALTH_ENDPOINTS=true`.
- Unauthenticated like `/info` (orchestrator probes can't carry the
renderer password) but expose no runtime version/path/license details.
- Keeps h2c: no HTTP/1.1 side-listener. New docs page documents working
`tcpSocket` + `exec` (`curl --http2-prior-knowledge`) probes for
Kubernetes, ECS, and Docker Compose, plus per-worker and cold-start
semantics.
## Codex Decision Log
- **Non-blocking:** where the routes live and what "workers online"
means
- **Decision:** routes registered in `worker.ts` (the master never
listens); a probe being answered proves the answering worker is up;
per-worker semantics documented
- **Why:** matches the existing `/info` route placement and cluster
architecture
- **Review later:** None
- **Non-blocking:** what "≥1 bundle loaded" means
- **Decision:** "compiled into the VM pool" (`hasAnyVMContext()`), not
"present in the disk cache"
- **Why:** the strict reading; stale on-disk bundles would over-report
readiness
- **Review later:** the resulting cold-start caveat and traffic-gating
guidance in the docs page
- **Non-blocking:** Kubernetes example readiness gate (codex review
finding, addressed)
- **Decision:** the main example uses a shallow `tcpSocket` readiness
probe; gating traffic on `/ready` is documented as a separate option
that requires a warm-up render path, with the deadlock failure mode (no
traffic → no first render → never ready, including the
sidecar/pod-readiness case) spelled out
- **Why:** gating cold replicas on `/ready` with no pre-warm path
deadlocks rollouts
- **Review later:** None
- Per triage cuts: no license check (Rails-side only), no token auth, no
Rails preflight helper, no pool-saturation counters, no HTTP/1.1
listener.
- `docs/oss/deployment/docker-deployment.md` intentionally untouched —
its broken `httpGet` probe is fixed by #3930; this PR's docs are written
to be consistent with it.
## Test plan
- New `tests/healthEndpoints.test.ts`: 404 when disabled; `/health` 200
status-only; `/ready` 503→200 transition through a real
render-with-bundle request; `/health` stable across bundle state. All
pass locally.
- `pnpm run lint`, `pnpm run type-check`, `pnpm run build`, `pnpm start
format.listDifferent`, `script/check-docs-sidebar origin/main`,
`script/check-pro-license-headers`: all pass.
- Full package jest suite: 331 pass; the 31 failures in 5 suites are
environment-only and reproduce identically on clean `origin/main` (no
local redis, streaming timeouts).
- `codex review --base origin/main`: two P2 findings (k8s readiness
deadlock guidance, changelog placeholder link) — both addressed in
follow-up commits.
🤖 Generated with [Claude Code](https://claude.com/claude-code)
## Merge Readiness Criteria
Current evaluation as of 2026-06-15 for head
`a7368575c1d0fe6c01497013173fe98ca32b9cd4`.
- **Release mode:** `accelerated-rc`, confirmed live from canonical
release gate #3823 (`Mode: accelerated-rc`).
- **Current head SHA:** `a7368575c1d0fe6c01497013173fe98ca32b9cd4`.
- **CI/check status:** Current-head `gh pr checks 3939 --repo
shakacode/react_on_rails --json bucket` reports 45 passing checks and 6
expected path-selected/skipped checks; no pending or failing checks.
`mergeStateStatus` is `CLEAN`.
- **Review-thread status:** Paginated GraphQL review-thread sweep
reports 44 total threads and `unresolved=0`.
- **Review feedback triage:** Fixed the shared-`truthy()` behavioral
concern by restoring the helper to `origin/main` behavior and scoping
`1` parsing to `RENDERER_ENABLE_HEALTH_ENDPOINTS`; added CodeQL
missing-rate-limiting suppressions for `/health` and `/ready`; skipped
the optional native `Error` `{ cause }` style cleanup because local
type-check rejects it under the package current TS/lib target;
acknowledged the non-actionable `createdApp?.close()` note.
- **Validation run:** `pnpm --dir
packages/react-on-rails-pro-node-renderer exec jest
tests/healthEndpoints.test.ts tests/configBuilder.test.ts --runInBand`
-> 53/53 pass; `pnpm --dir packages/react-on-rails-pro-node-renderer run
type-check` -> pass; `node script/generate-llms-full.mjs --check` ->
pass; `pnpm start format.listDifferent` -> pass;
`script/check-docs-sidebar origin/main` -> pass;
`script/check-pro-license-headers` -> pass; `script/ci-changes-detector
origin/main` -> Pro node-renderer package path detected; `pnpm run
build` -> pass; `pnpm run lint` -> pass; `git diff --check
--no-ext-diff` -> pass; `(cd react_on_rails && BUNDLE_GEMFILE=../Gemfile
bundle exec rubocop)` -> pass/no offenses; branch autoreview against
`origin/main` -> clean; pre-commit and pre-push hooks -> pass.
- **Label/CI decision:** Labels: `full-ci`. This remains appropriate
because the PR touches Pro node-renderer health/readiness behavior. No
benchmark label recommended because the endpoints are opt-in,
status-only probes and do not affect render throughput paths.
- **Known residual risk:** No unresolved review thread or failing check
remains. Accelerated-RC independent finalizer/confidence gate is not
satisfied by this author/coordinator session.
- **Merge recommendation:** Ready for maintainer/independent finalizer.
Do not auto-merge from this session under accelerated-RC finalizer
rules.
<!-- CURSOR_SUMMARY -->
---
> [!NOTE]
> **Medium Risk**
> Touches production deployment probes and readiness semantics
(per-worker, bundle-compilation gate); misconfigured readiness on
`/ready` can deadlock rollouts, though docs call this out and the
feature is opt-in.
>
> **Overview**
> **Pro node renderer** gains **opt-in** built-in **`GET /health`**
(liveness, always `200` when the worker responds) and **`GET /ready`**
(readiness: `503` until the answering worker has at least one bundle
**compiled** in its VM pool via new `hasAnyVMContext()`, then `200`).
Both are off by default and turned on with **`enableHealthEndpoints`**
or **`RENDERER_ENABLE_HEALTH_ENDPOINTS`** (`true`/`yes`/`1`, with `1`
scoped only to this flag).
>
> Routes register on the worker Fastify app (like `/info`), return
status-only JSON, and run **before** `configureFastify`; conflicting
custom `/health` or `/ready` routes get a clearer migration error when
`FST_ERR_DUPLICATED_ROUTE` matches.
>
> Documentation adds a **health-checks** guide (h2c / `tcpSocket` +
`exec` probes, cold-start and `/ready` traffic-gating caveats) and
updates **js-configuration** and the docs sidebar; **CHANGELOG** and
**llms-full** are updated accordingly.
>
> <sup>Reviewed by [Cursor Bugbot](https://cursor.com/bugbot) for commit
df10515. Bugbot is set up for automated
code reviews on this repo. Configure
[here](https://www.cursor.com/dashboard/bugbot).</sup>
<!-- /CURSOR_SUMMARY -->
## Agent Merge Confidence
Mode: accelerated-rc
Current head SHA: df10515
Score: 8/10
Auto-merge recommendation: yes; maintainer-directed merge requested
after conflict resolution
Affected areas: React on Rails Pro node renderer health/readiness
endpoints, node renderer docs, generated llms reference
CI detector: `script/ci-changes-detector origin/main` -> Pro node
renderer package; recommends lint, Pro lint/specs/dummy integration,
node-renderer tests, and benchmark coverage.
Validation run:
- `node script/generate-llms-full.mjs && node
script/generate-llms-full.mjs --check` -> passed after conflict
resolution.
- `git diff --check` -> passed after conflict resolution.
- Pre-push hooks on resolved head -> RuboCop branch lint passed;
Markdown link checks passed with lychee 0.23.0.
Review/check gate:
- GitHub checks: complete for
`df105150098f2e7adb6c41cf9a4ee5dc53c7ab3d`; 45 passed, 5 expected
selector/placeholder skips, 0 failed.
- Review threads: GraphQL unresolved count is 0.
- Current-head reviewer verdicts:
- Claude review: passed for current head.
- Cursor Bugbot: passed for current head.
- CodeRabbit: passed for current head.
Known residual risk: low; node renderer readiness/health endpoint
behavior is covered by the package checks, but this remains a
release-candidate infrastructure path.
Finalized by: maintainer-directed merge requested by @justin808 in Codex
session on 2026-06-15; this is not an autonomous accelerated-RC merge.
---------
Co-authored-by: Claude Fable 5 <noreply@anthropic.com>1 parent e3f0590 commit 225738e
10 files changed
Lines changed: 934 additions & 9 deletions
File tree
- docs
- oss/building-features/node-renderer
- packages/react-on-rails-pro-node-renderer
- src
- worker
- tests
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
35 | 39 | | |
36 | 40 | | |
37 | 41 | | |
| |||
Lines changed: 248 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
Lines changed: 14 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
51 | 52 | | |
52 | 53 | | |
53 | 54 | | |
| |||
302 | 303 | | |
303 | 304 | | |
304 | 305 | | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| 312 | + | |
| 313 | + | |
| 314 | + | |
305 | 315 | | |
306 | 316 | | |
307 | 317 | | |
| |||
417 | 427 | | |
418 | 428 | | |
419 | 429 | | |
420 | | - | |
421 | | - | |
422 | | - | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
423 | 434 | | |
424 | 435 | | |
425 | 436 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
117 | 117 | | |
118 | 118 | | |
119 | 119 | | |
| 120 | + | |
120 | 121 | | |
121 | 122 | | |
122 | 123 | | |
| |||
0 commit comments