You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1ad6f58
Browse filesBrowse the repository at this point in the historyBrowse files
fix(hocuspocus): cache REST health checks and keep error text out of them
Each REST health check now costs at most one dependency call every 5 s
per process. Concurrent callers share one in-flight check, so a /health
flood no longer reaches the database, Redis or Supabase on every request.
A failed check returns only its status and time. The driver text could
name a host and a port, so it now goes to the server log as a
'Health check failed' warning. The OpenAPI schema drops the error field,
and the database probe no longer claims pool metadata.
The rest-api container healthcheck now reads /health/database in both
compose files. Both replicas share one Redis, so a Redis stall marked both
unhealthy, and Traefik then had no server for any /api route. REST runs
without Redis, because its limiter fails open.
The public API guide now names /health/live for a load-balancer check.
Refs #405
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Copy file name to clipboardExpand all lines: apps/hocuspocus.server/API.md
+7-3Lines changed: 7 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -75,7 +75,7 @@ The documents controller emits this envelope on error and `{ "success": true, "d
75
75
76
76
## Health
77
77
78
-
Health routes are exempt from rate limiting. Each returns `200` when healthy and `503` otherwise. Source: `src/api/routers/health.router.ts`, `src/api/services/health.service.ts`.
78
+
Health routes are exempt from rate limiting. Each returns `200` when healthy and `503` otherwise. Source: `src/api/routers/health.router.ts`, `src/api/services/health.service.ts`. Each dependency check is cached for 5 s per process, and concurrent callers share one check. A failed check returns no error text. The reason goes to the server log as a `Health check failed` warning. The `rest-api` container healthcheck reads `/health/database`, so a Redis stall does not mark the replicas unhealthy ([#405](https://github.com/docs-plus/docs.plus/issues/405)).
79
79
80
80
### GET /health
81
81
@@ -86,7 +86,7 @@ Aggregate check across database, Redis, and Supabase. Returns `degraded` (`503`)
@@ -95,9 +95,13 @@ Aggregate check across database, Redis, and Supabase. Returns `degraded` (`503`)
95
95
96
96
Per-service `status` is one of `healthy`, `unhealthy`, or `disabled` (Redis/Supabase when not configured).
97
97
98
+
### GET /health/live
99
+
100
+
Liveness only. Answers `200` while the process is up. It calls no dependency, so it never answers `503`. The Traefik probe reads it. Use it for a load-balancer check.
101
+
98
102
### GET /health/database
99
103
100
-
Database connectivity (`SELECT 1`) plus pool metadata.
Copy file name to clipboardExpand all lines: apps/hocuspocus.server/CLAUDE.md
+1Lines changed: 1 addition & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -223,6 +223,7 @@ Moved verbatim out of the repo-root [AGENTS.md](../../AGENTS.md). The `### Supab
223
223
### Production And Docker Compose
224
224
225
225
- Dev compose backend services need `context: .` at repo root to match `Dockerfile.bun`.
226
+
-**The `rest-api` Docker healthcheck reads `/health/database` on purpose ([#405](https://github.com/docs-plus/docs.plus/issues/405)).** Do not point it back at `/health`. Both replicas share one Redis, so a Redis stall marks both unhealthy, and Traefik then has no server for any `/api` route. Do not point it at `/health/live` either. The deploy waits on this status, so it needs a real dependency. Each REST health check is cached for 5 s per process, and a failure body carries no error text. The Settled rule against a Docker HEALTHCHECK change covers only the webapp Next probe.
226
227
- Hocuspocus image:
227
228
-`migration-extensions.ts` imports `@docs.plus/extension-hypermultimedia` and `@docs.plus/extension-inline-code` at runtime.
0 commit comments