Repository navigation
Conversation
|
Important Review skippedAuto reviews are disabled on this repository. Please check the settings in the CodeRabbit UI or the ⚙️ Run configuration
You can disable this status message by setting the Use the checkbox below for a quick retry:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configuration
📒 Files selected for processing (16)
Included review availability: This review used your included allowance. Your plan provides up to 1 included review per hour; 0 remain after this review. 📜 Recent review details🧰 Additional context used📚 Code guidelines (4)📓 Path-based instructions (11)Source excerpt: Write tests for new functionality.📄 CodeRabbit inference engine (CONTRIBUTING.md) Files:
Source excerpt: **Integration test needing Docker** → add a subtest under `tests/integration/` (e.g.📄 CodeRabbit inference engine (docs/src/content/docs/development.md) Files:
Source excerpt: Create `*_test.go` files in the same package as the code under test.📄 CodeRabbit inference engine (AGENTS.md) Files:
See [AGENTS.md](../AGENTS.md) for project conventions, architecture notes, and AI agent instructions.📄 CodeRabbit inference engine (.github/copilot-instructions.md) Files:
Source excerpt: Create the package under `internal/`.📄 CodeRabbit inference engine (AGENTS.md) Files:
Source excerpt: **Never hard-wrap prose.📄 CodeRabbit inference engine (AGENTS.md) Files:
Source excerpt: **Docs prose**: never hard-wrap Markdown — one paragraph is one line.📄 CodeRabbit inference engine (CONTRIBUTING.md) Files:
Source excerpt: **Go 1.26**, strict formatting (`gofumpt`, enforced by CI)📄 CodeRabbit inference engine (AGENTS.md) Files:
Source excerpt: **Formatting**: Code must be formatted with `gofumpt` (a strict superset of `gofmt`).📄 CodeRabbit inference engine (CONTRIBUTING.md) Files:
Source excerpt: **Strict Go formatting**: Use `gofumpt` (a stricter superset of `gofmt`, enforced by CI).📄 CodeRabbit inference engine (docs/src/content/docs/development.md) Files:
Source excerpt: **E2E test via SDK** → add a `tests/e2e/sdk/*.test.ts` file.📄 CodeRabbit inference engine (docs/src/content/docs/development.md) Files:
🧠 Learnings (2)📚 Learning: 2026-06-26T12:23:22.696ZApplied to files:
📚 Learning: 2026-08-11T21:55:53.726ZApplied to files:
🪛 LanguageToolCHANGELOG.md[typographical] ~111-~111: Consider using an em dash in dialogues and enumerations. (DASH_RULE) [style] ~111-~111: This sentence is over 40 words long. Consider splitting it up, as shorter sentences make the text easier to read. (TOO_LONG_SENTENCE) 📝 SummarySummary by CodeRabbit
WalkthroughThe change ties cached ClickHouse HTTP clients to pool tuple release. Pool reconciliation returns released tuples, and application reload wiring schedules client removal after the pool grace period. Ingest workers now use caller-provided client caches. Tests cover cache retention, idle connection closure, and reload behavior. ChangesClickHouse HTTP client lifecycle
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Sequence Diagram(s)sequenceDiagram
participant App
participant Pools
participant HTTPClients
App->>Pools: Reconcile wanted members
Pools-->>App: Return released tuples
App->>HTTPClients: Release each tuple
HTTPClients->>HTTPClients: After grace, remove client and close idle connections
Suggested reviewers: Merge Risk: ⚪ Minimal · up to The client cleanup appears to preserve clients for active tenants, including when a reload reports another pool error. No issue identified here needs resolution before merge. 🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
Full details: Docstring CoverageExplanation Docstring coverage is 79.07% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 43 functions across 13 files. (3 skipped: 3 unsupported.) ✨ Finishing Touches 💡 1📝 Generate docstrings 💡
🧪 Generate unit tests (beta)
✨ Simplify code
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
|
📚 Docs preview is live → https://a21088a1-wavehouse-docs.wave-rf.workers.dev |
Code Coverage OverviewLanguages: Go GoThe overall line coverage in commit 29fbb0b in the Show a line coverage summary of the most impacted files.
Updated |
|
@coderabbitai review |
✅ Action performedReview finished.
|
Summary
The native ClickHouse pools follow the tenants: a tuple no served tenant names is released after a grace. The two HTTP-interface consumers, the ingest worker's inserts and the
/v1/ops/queryproxy, each keep their ownhttp.Clientcache, and nothing ever dropped a client from it. A tuple with atlsblock gets a TLS config of its own each time its pool opens, so once a tenant was removed, moved to another ClickHouse, or rotated its password, the client made for its old tuple stayed for the life of the process with its idle connections open until the transport's own idle timeout. A test that opened and released one tuple five times counted five clients, each still holding its connection after the native pool had closed.Pools.Reconcilealso returns the tuples it released, with the grace each pool closes after, whether the tenants on it were removed or moved to another address, database, user ortlsblock.query_timeoutamong the tenants the tuple had, so a request in flight finishes. A tuple another tenant still names keeps its client; one that opens again gets a fresh one.Runstarts the worker.tlsblock share one client per cache, which stays: nothing in it belongs to one tuple, and a removed tenant's idle plain-HTTP connections ride out the transport's idle timeout on their own.Test plan
tlsclient stays; only idle connections are closed (internal/chconn)internal/app)internal/api,internal/ingest)make ciRelated Issues
Closes #713
Part of #583 (story 6)