Repository navigation
Release v0.55.24: shorter GC stalls, no 502 on reused backend connections - #2001
Open
helpcodeai wants to merge 3 commits into
Open
helpcodeai wants to merge 3 commits into
helpcodeai wants to merge 3 commits into
Conversation
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Release v0.55.24. This PR carries the version bump (0.55.23 → 0.55.24 in the three
package.jsonfiles,package-lock.jsonandserver.json) together with the change below, to save one CI cycle. It merges last, after #1998, #1999 and #2000; the release also contains #1995, #1996 and #1997, which are already on main.On 2026-12-06 at 07:36 UTC the Cloud uptime probe reported one minute of downtime. The backend never restarted. A garbage collection froze its event loop for about 8 s, and the probe's
/mcp/democall then went out on an upstream connection the backend had just closed: Caddy answered 502 (connection reset by peer). It was the only 5xx of that minute (714 requests), but 49 requests took over 5 s.One week of
vitalslog lines (19,757 samples) shows the pattern behind it:A bigger heap did not reduce the stalled time. It moved it into fewer, longer freezes. The stalls follow old-space collections (median 1.0 s at 4 GB and 1.7 s at 6 GB when the heap drops by more than 600 MB between two samples; 0.14-0.36 s otherwise). The old space fills fast because V8's default 16 MB young generation promotes the garbage of every tool call.
Changes
KEEP_ALIVE_TIMEOUT=65000, as the backend has. Next's standalone server closed idle connections after 5 s; three POSTs to the frontend got a 502 from that in the last 36 h.start.sh: new opt-inNODE_MAX_SEMI_SPACE_MB(digits only; unset or 0 keeps V8's default) passed as--max-semi-space-size.docker-compose.cloud.yml: Cloud defaultNODE_MAX_SEMI_SPACE_MB=64.gcblock with count, total and longest pause per kind (major,minor,incremental) since the previous line, from aPerformanceObserver. The next heap or semi-space change can then be measured..env.example: the new variable.Deployment modes: self-hosted keeps V8's defaults unless the operator sets
NODE_MAX_SEMI_SPACE_MB; it gets thegcblock in the vitals line. The Caddyfile and the compose default are Cloud only.Not in this PR: the Cloud heap limit itself (
NODE_MAX_OLD_SPACE_MBin the server.env) goes from 6144 to 5120 with the deploy, to cap the size of one collection while keeping more room than 4 GB gave by day.Type
Testing
Added/updated unit tests
Tested manually (describe steps below)
No tests needed (explain why)
packages/backend:npx jest --maxWorkers=4 src/common/process-vitals.spec.ts: 32 passed (3 new).npx tsc --noEmit -p tsconfig.json: no errors.npx eslinton the three changed files: no findings.Caddyfile: adapted with the production Caddy binary (
caddy adapt, read-only): all 28reverse_proxyhandlers (24 backend, 4 frontend) carrykeep_alive.idle_timeout55 s. The frontend'sserver.jsin the running image readsKEEP_ALIVE_TIMEOUT.start.sh:sh -npasses; the flag logic gives no flag for unset,0,abc,6x4and--max-semi-space-size=64for64. Node 26 starts with the flag.GC observer checked on Node 26.13:
gcentries carrydetail.kind.Checklist
npm test)Related Issues
Found in the 2026-12-06 daily check.