feat: make ClickHouse connection limit configurable - #4492
Conversation
Implemented and tested with AI assistance; reviewed by Arthur Braga.
|
@arthurbragaa is attempting to deploy a commit to the Umami Software Team on Vercel. A member of the Team first needs to authorize it. |
Greptile SummaryThe PR adds a validated
Confidence Score: 4/5The PR should not merge until ClickHouse-specific validation is gated so PostgreSQL-only deployments cannot be broken by an irrelevant environment value. The new module-scope and preflight checks reject CLICKHOUSE_MAX_OPEN_CONNECTIONS before determining whether ClickHouse is enabled, making an unused setting capable of breaking route loading, builds, and container startup. Files Needing Attention: src/lib/clickhouse.ts, scripts/check-db.js
|
| Filename | Overview |
|---|---|
| src/lib/clickhouse.ts | Adds the client pool option, but validates it at module load even when ClickHouse is disabled. |
| scripts/check-db.js | Adds matching preflight validation before both ClickHouse applicability and the SKIP_DB_CHECK bypass. |
| src/lib/clickhouse.test.ts | Covers valid, unset, and malformed values but not the disabled-ClickHouse or SKIP_DB_CHECK cases. |
| README.md | Documents the option, client default, and aggregate pool sizing across replicas. |
Flowchart
%%{init: {'theme': 'neutral'}}%%
flowchart TD
Env[Environment] --> URL{CLICKHOUSE_URL set?}
Env --> Limit[Parse CLICKHOUSE_MAX_OPEN_CONNECTIONS]
Limit -->|Invalid| Fail[Throw or exit]
URL -->|Yes| CH[Create ClickHouse client]
URL -->|No| PG[Use PostgreSQL]
Limit -->|Valid or unset| CH
Limit -. currently evaluated even here .-> PG
Reviews (1): Last reviewed commit: "feat: make ClickHouse connection limit c..." | Re-trigger Greptile
Summary
CLICKHOUSE_MAX_OPEN_CONNECTIONSconfigurationCloses #4491.
Verification
pnpm test— 95 files, 748 testspnpm exec tsc --noEmitpnpm build25peaked at 25 with 50/50 successful/api/sendrequests; invalid0exited before health startupFull
pnpm lintremains blocked by pre-existing diagnostics ondev; the changed files pass Biome.AI assistance disclosure: This contribution was implemented and tested with AI assistance and reviewed by Arthur Braga Alfredo.
Need help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.