FKITDEV-7973: Sequelize Connection Pool Right-Sizing
Review asks implemented and pushed — awaiting re-review
Both of Pocok256’s open asks (min: 0, drop the evict: 10000 override) landed in commit c89124e29c on 2026-07-27; vuer_oss PR #7852 head is now at that SHA. See Review feedback implemented (2026-07-27).
Still not merged — PR #7852 remains mergeable_state: blocked
The fix is on the branch, not on devel. The two CHANGES_REQUESTED reviews (Pocok256, bencevarga666) still stand — GitHub keeps a PR blocked until the reviewers dismiss/re-approve, and no re-review was requested and no PR comment was posted. Also still open: PR body TÖLTSD KI placeholder, branch ~58 commits behind devel, and Bence László’s measure-first (options.logging + benchmark) guidance. See Net actionable state.
Problem
Default Sequelize pool (max: 100) per process, across 7 Supervisor-managed processes, exhausted PostgreSQL connection slots in dev environments. Error: SequelizeConnectionError: remaining connection slots are reserved for roles with the SUPERUSER attribute, triggered in the “Audit log forward” cron job.
Root Cause
server/db/sequelize.js only set pool.max: 100 with no lifecycle settings (idle, acquire, evict). With 7 processes each potentially opening 100 connections (700 total), and PostgreSQL defaults of 100-200 max_connections, slots got exhausted. Stale connections never released.
Fix Applied (initial, 2026-03-31)
Changed server/db/sequelize.js pool defaults:
max: 100 → max: 10 (7×10=70, safe for PG defaults)
Added idle: 10000 (release idle connections after 10s)
Added acquire: 30000 (30s timeout acquiring from pool)
Added evict: 10000 (check for idle connections every 10s) — superseded, override removed
Also fixed shallow Object.assign to deep-merge pool config, so individual pool properties can be overridden via db.options.pool.* in config files without losing other defaults.
Source: GitHub API, read 2026-07-27 (view-only at capture time). One review thread, three comments, on server/db/sequelize.jsline 27 (the new pool block). Later the same day a fix commit was pushed (Review feedback implemented (2026-07-27)) — but still no PR comments and no re-review requests were written to GitHub.
PR state
Field
Value
PR
TechTeamer/vuer_oss#7852
Branch → base
feature/FKITDEV-7973 → devel
Author
wowjeeez
State
open, mergeable_state: blocked
Branch tip
was 7da69cba85 (2026-04-01) → now c89124e29c (2026-07-27); still ~58 commits behind devel
Szerintem az 1 másodperces default keresés itt teljesen jó. Ha már egy kapcsolatot zárhatónak jelöl nem probléma az ha zárja is minél hamarabb. én személy szerint a max poolt fentebb venném mert anno a 100 is kevés volt.
Gloss: Sequelize’s default 1s evict sweep is fine — i.e. the evict: 10000 override is unwanted; once a connection is marked closable, closing it ASAP is not a problem. Also wanted max raised, because “even 100 was too little back then”.
Gloss: rebuts raising max. Don’t inflate it indefinitely — 7 processes share this, keep it bounded to avoid saturation, consider per-process pool configs, stay below the DB’s max_connections, and the PostgreSQL wiki favours few concurrent connections.
Teljesen jogos de a 7 azért elég strict cli és egyéb is újat nyit. alapesetben egy 10 es érték akkor elegendő. Még annyi hogy a min érték akár 0 is lehetne ha 1 seces lesz az idle connection zárása.
Gloss: concedes the point. Counting only 7 processes understates reality (CLI and other tooling open their own connections), so max: 10 as a default is sufficient. Adds one more ask: min could be 0 if idle connections are closed on a ~1s cadence — consistent with his May stance of keeping the default evict: 1000 rather than the PR’s evict: 10000.
Slight ambiguity in comment 3 — resolved as evict
“ha 1 seces lesz az idle connection zárása” could mean idle: 1000or keeping Sequelize’s default 1s evict sweep. His 2026-05-06 comment points at the latter, so the 2026-07-27 fix removed the evict override (default 1s sweep restored) and left idle: 10000 untouched. If a reviewer actually meant idle: 1000, that’s a one-line follow-up.
Review feedback implemented (2026-07-27)
For Agents
Commit c89124e29cfaecc3e19dd00def53f26f9302e4a5 — fix: set pool min to 0 and use default evict interval. Pushed solo-author (Andras Lederer) to feature/FKITDEV-7973; remote ref and PR #7852 head both confirmed at c89124e2. Work done in the kept worktree vuer_oss/.worktrees/feature/FKITDEV-7973.
What changed
Two files — server/db/sequelize.js and its mirrortest/lib/utils/db.utils.js (the test harness duplicates the pool config, so both must move together):
acquire lost its trailing comma (it is now the last property — standard-style lint)
Diff is exactly 2 files, +4 / −6.
This satisfies Pocok256 precisely: his 2026-07-27 condition (“min could be 0 if idle connections are closed on a 1s cadence”) plus his May ask (the default 1s check is fine, so the override is unwanted) — the two are one change, since min: 0 is only safe because the sweep is fast.
Verification
Check
Result
node --check on both files
OK
eslint --max-warnings 0 on both files
exit 0 (ESLint 9 flat config via FlatCompat / standard)
git show diff shape
exactly 2 files, +4/−6
Remote ref + PR head
both at c89124e2
Repo gotcha — yarn lint does NOT cover test/
The packaged yarn lint script passes --ignore-pattern "test/*", so a change to test/lib/utils/db.utils.js (or any test file) is invisible to yarn lint and to the CI lint gate. The flat config does define a test/** block, so lint it explicitly:
Code asks only. No re-review requested, no PR comment posted, PR body untouched, no devel catch-up, measure-first guidance not started — see Net actionable state for exactly what remains.
Net actionable state
✅ Settled: max: 10 is accepted by both reviewers — do not raise it. (unchanged in c89124e29c)
⬜ Considered, not decided: per-process pool configs (Bence’s point 1) — 7 processes have different profiles; would need db.options.pool.* per supervisor process. Not implemented.
⬜ Constraint to honour: total pool ceiling must stay below PostgreSQL max_connections. Still satisfied at max: 10.
⬜ Housekeeping, still open: PR body Summary is still the TÖLTSD KI placeholder; branch is still ~58 commits behind devel (no merge/rebase done).
⬜ Still unaddressed from the ticket — Bence László’s original guidance (see Bence László’s Review (Assignee)): enable options.logging + options.benchmark, then benchmark and measure before finalizing the numbers. logging is still hardcoded after the config spread in server/db/sequelize.js, so db.options.logging remains non-overridable — this blocks the “measure first” step the assignee asked for.
⬜ NEXT ACTION — both CHANGES_REQUESTED reviews still stand ⇒ PR remains mergeable_state: blocked. The code asks are now met, but no re-review was requested and no PR comment was posted, so nothing prompts Pocok256 / bencevarga666 to look again. Unblocking needs: ping/re-request both reviewers, fill the PR body, and catch up with devel.
Escalation Path
If pool tuning doesn’t resolve, check for multiple Sequelize instances and consider PgBouncer for connection multiplexing.