Repository navigation
Conversation
Zetazzz
force-pushed
the
agent/graphile-readiness-disposal
branch
from
September 6, 2026 01:51
dec013c to
e77d653
Compare
Zetazzz
force-pushed
the
test/performance-harness-core
branch
2 times, most recently
from
September 7, 2026 03:22
658736e to
f7c63ec
Compare
Zetazzz
force-pushed
the
agent/graphile-readiness-disposal
branch
from
September 9, 2026 04:19
e77d653 to
e7d7636
Compare
This was referenced Sep 9, 2026
Zetazzz
marked this pull request as ready for review
September 21, 2026 15:47
|
Review complete. 🟡 1 medium 💬 Inline comments (1)
This PR reworks
The change is well-structured and well-tested; the main concern is that the perf-harness metering in Reviewed commit: 1c9dfb1 |
There was a problem hiding this comment.
Adds caching-instance and service-lifecycle logic to graphile-cache (preset services, build readiness, disposal) plus a perf-harness connection-lifecycle suite, with new CI wiring.
Key findings
- 🟡 Replacement/failed-build modes skip real release accounting — worker.ts:200
Zetazzz
marked this pull request as draft
September 21, 2026 16:13
Zetazzz
marked this pull request as ready for review
September 21, 2026 16:13
This was referenced Sep 21, 2026
This was referenced Oct 11, 2026
Consolidate PR #1747, including its merge-owned release instrumentation, before rebasing onto current main.
Zetazzz
force-pushed
the
agent/graphile-readiness-disposal
branch
from
November 4, 2026 04:17
89f4561 to
241db5e
Compare
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.
Problem and result
Evicting a Graphile instance on main releases PostGraphile but leaves its preset PostgreSQL services alive. An active subscription therefore keeps a database connection checked out and continues receiving notifications after its instance is evicted.
This PR releases generation-owned services during disposal and failed-build cleanup, and makes cleanup failures observable. The reproduced connection leak is eliminated: four successive evictions leave zero checked-out connections instead of four.
Before / after verification
Compared a fresh build of main
299b3920with the rebased implementation241db5e1, using Node 24.20.0, PostgreSQL 18.6, and unmodified@dataplan/pg1.1.1. The final commit209fa6b9changes only CI test placement.Each of four sequential cycles creates a real Graphile instance with a fresh service, executes a GraphQL read, confirms subscription readiness through notification delivery, and evicts the instance. All cycles share one caller-owned pool. Observations are recorded before fixture teardown or explicit cleanup, so test teardown cannot hide leaked connections.
All eight GraphQL reads returned the expected value, and schema hashes matched across both versions. With an injected schema-build failure and an already active subscriber, the PR also returned the checked-out connection (1 → 0), released the service exactly once, preserved the original error, and produced no unhandled rejection.
Test coverage
209fa6b9: CI run 41773958164, including Windows and PostgreSQL tests. The complete graphile-cache suite runs in the PostgreSQL batch; CI matrix coverage still includes all 118 packages with tests.unregisterwarning remains.The rebase preserves main's heap measurement, cache budget, and LRU behavior. Regression coverage verifies that budget rejection and subsequent disposal release PostGraphile and its services only once. Cleanup attempts the remaining resources after a failure, and pool shutdown is attempted even when generation cleanup rejects.
Conclusion and limits
This is a demonstrated resource-lifecycle fix, with practical value for subscription workloads that repeatedly rebuild or evict Graphile instances. It prevents retired generations from accumulating checked-out connections and consuming pool capacity. Query throughput and latency improvements were not measured; no speedup percentage is claimed.
Reproduce the lifecycle suite
Build
graphile-cacheand@constructive-io/perf-harness, then run against a local PostgreSQL test administrator account. The suite creates and tears down isolated databases throughpgsql-test.node packages/perf-harness/dist/connection-lifecycle/suite.js \ --database-url '<local PostgreSQL test administrator URL>' \ --output /tmp/graphile-connection-lifecycle.jsonRefs constructive-io/constructive-planning#1693 (F04).