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
Implements F19 from constructive-io/constructive-planning#1693, stacked on #1852 (F17) and #1747 (F04).
Cache misses reserve resident count and process-heap headroom before allocating preset services. The existing LRU remains the resident owner. Admission counts reservations, residents, and disposal in progress, awaits evicted resources, and disposes oversized completed builds before publication. Failed cleanup latches admission unavailable until process restart: acknowledging a failure does not prove resources were released.
graphql-env owns parsing, defaults, and final validation for graphile.cache max, TTL, heap watermark, and build reserve. File < environment < runtime precedence is preserved, including runtime values above environment defaults. Explicit malformed values fail. Defaults are 50 residents, a five-minute development TTL or 366-day production TTL, an 85% V8 heap watermark, and 64 MiB per pending build.
The first owner can replace fallback limits; subsequent owners share the strictest limits. The same LRU now enforces the configured resident ceiling dynamically, including values above 50. Expired entries are reclaimed before admission. Capacity cannot be lowered below current ownership, and TTL cannot change while residents exist. This is process-heap admission, not exact per-instance measurement or an RSS guarantee. Upstream background subscriber cleanup remains outside F04's public release boundary.
Validation: 65 cache/admission/release tests verified at this layer; 90 environment tests and snapshot; canonical 503 normalization tests. Errors, graphql-types/env, graphile-cache, server and Explorer builds passed. Frozen-lockfile installation, dependency policy, and test registration checks passed. Final stack validation is recorded in #1855.
🟠 Disposal failure permanently bricks all schema admission — admission.ts:71
This PR introduces a memory-aware admission and eviction controller for the plan cache: admission.ts gates schema builds against a heap budget, admitted-build.ts tracks per-owner reservations and released entries, and graphile-cache.ts/create-instance.ts route build and disposal through it. The GraphQL server wires the new build flow into the request-lifecycle middleware and explorer server with single-flight deduplication, while graphql/env gains parsing/validation/merge helpers used to feed cache and config options. A single high-severity finding remains in the admission controller's failure latch.
The reason will be displayed to describe this comment to others. Learn more.
Adds a process-heap admission/eviction controller for the schema plan cache, wires it through the GraphQL server instance build path, and adds env/config validation helpers in the graphql/env package.
Key findings
🟠 Disposal failure permanently bricks all schema admission — admission.ts:71
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
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.
Implements F19 from constructive-io/constructive-planning#1693, stacked on #1852 (F17) and #1747 (F04).
Cache misses reserve resident count and process-heap headroom before allocating preset services. The existing LRU remains the resident owner. Admission counts reservations, residents, and disposal in progress, awaits evicted resources, and disposes oversized completed builds before publication. Failed cleanup latches admission unavailable until process restart: acknowledging a failure does not prove resources were released.
graphql-envowns parsing, defaults, and final validation forgraphile.cachemax, TTL, heap watermark, and build reserve. File < environment < runtime precedence is preserved, including runtime values above environment defaults. Explicit malformed values fail. Defaults are 50 residents, a five-minute development TTL or 366-day production TTL, an 85% V8 heap watermark, and 64 MiB per pending build.The first owner can replace fallback limits; subsequent owners share the strictest limits. The same LRU now enforces the configured resident ceiling dynamically, including values above 50. Expired entries are reclaimed before admission. Capacity cannot be lowered below current ownership, and TTL cannot change while residents exist. This is process-heap admission, not exact per-instance measurement or an RSS guarantee. Upstream background subscriber cleanup remains outside F04's public release boundary.
Validation: 65 cache/admission/release tests verified at this layer; 90 environment tests and snapshot; canonical 503 normalization tests. Errors, graphql-types/env, graphile-cache, server and Explorer builds passed. Frozen-lockfile installation, dependency policy, and test registration checks passed. Final stack validation is recorded in #1855.
Next layers: #1854 (F20), then #1855 (F21).