Commit 80e967e
committed
fix(graphile-schema): route buildSchemaSDL pool through pg-cache for proper cleanup
Previously, buildSchemaSDL let makePgService create its own internal pg Pool
using a connection string. This pool was not tracked by pg-cache, so when
ephemeral database teardown called pgCache.delete() + dropdb, PostGraphile's
pool connections remained open, causing:
- 'database has active sessions' errors on dropdb
- pg_terminate_backend killing those connections
- 'terminating connection due to administrator command' (57P01) errors
bubbling up to the user
Fix: Create the pool via getPgPool() (which registers it in pgCache) and pass
it directly to makePgService. Now the existing cleanup code in pgpm-module.ts
and generate.ts (pgCache.delete + waitForDisposals) properly closes the
PostGraphile pool before dropping the ephemeral database.1 parent d7ad4d8 commit 80e967e
1 file changed
Lines changed: 8 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
| |||
17 | 17 | | |
18 | 18 | | |
19 | 19 | | |
20 | | - | |
21 | | - | |
22 | | - | |
23 | | - | |
24 | | - | |
25 | | - | |
26 | | - | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
27 | 26 | | |
28 | 27 | | |
29 | 28 | | |
30 | 29 | | |
31 | 30 | | |
32 | | - | |
| 31 | + | |
33 | 32 | | |
34 | 33 | | |
35 | 34 | | |
| |||
0 commit comments