-
Notifications
You must be signed in to change notification settings - Fork 1.1k
feat(tools/Clickhouse): configurable connection pool settings #2244
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello @ankurg03, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the ClickHouse source configuration by externalizing key connection pool parameters. Users can now specify Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request successfully makes the ClickHouse connection pool settings (MaxOpenConns, MaxIdleConns, ConnMaxLifetime) configurable, replacing the previous hardcoded values. The changes are well-implemented, including updates to the configuration struct, initialization logic, and corresponding tests.
My review includes a few suggestions to further improve the code's robustness and maintainability:
- Adding validation tags to the new configuration fields to prevent invalid values.
- Refactoring the
initClickHouseConnectionPoolfunction to accept theConfigstruct directly, which will simplify its signature and improve maintainability. - Enhancing the tests to verify that the connection pool settings are correctly applied, not just that error paths are handled.
| } | ||
| } | ||
|
|
||
| func TestInitClickHouseConnectionPoolWithPoolSettings(t *testing.T) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test function TestInitClickHouseConnectionPoolWithPoolSettings primarily verifies error handling for connMaxLifetime, but it doesn't test the successful application of the pool settings (MaxOpenConns, MaxIdleConns). The 'happy path' test cases only confirm that a connection error occurs later, without verifying that the settings were applied correctly.
To properly test this logic, you could use a mocking library (like sqlmock) to provide a mock *sql.DB. This would allow you to assert that SetMaxOpenConns, SetMaxIdleConns, and SetConnMaxLifetime are called with the expected values based on the test case inputs. This would ensure the core logic of this feature is correctly tested.
d3e6a3c to
01848ab
Compare
d84aaaa to
967d0cb
Compare
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/cache](https://redirect.github.com/actions/cache) | action | major | `v4` -> `v5` | | [actions/checkout](https://redirect.github.com/actions/checkout) | action | major | `v5.0.1` -> `v6.0.1` | | [actions/checkout](https://redirect.github.com/actions/checkout) | action | major | `v5` -> `v6` | | [golangci/golangci-lint-action](https://redirect.github.com/golangci/golangci-lint-action) | action | major | `v8.0.0` -> `v9.2.0` | --- ### Release Notes <details> <summary>actions/cache (actions/cache)</summary> ### [`v5`](https://redirect.github.com/actions/cache/compare/v4...v5) [Compare Source](https://redirect.github.com/actions/cache/compare/v4...v5) </details> <details> <summary>actions/checkout (actions/checkout)</summary> ### [`v6.0.1`](https://redirect.github.com/actions/checkout/compare/v6.0.0...v6.0.1) [Compare Source](https://redirect.github.com/actions/checkout/compare/v6.0.0...v6.0.1) ### [`v6.0.0`](https://redirect.github.com/actions/checkout/compare/v5.0.1...v6.0.0) [Compare Source](https://redirect.github.com/actions/checkout/compare/v5.0.1...v6.0.0) </details> <details> <summary>golangci/golangci-lint-action (golangci/golangci-lint-action)</summary> ### [`v9.2.0`](https://redirect.github.com/golangci/golangci-lint-action/releases/tag/v9.2.0) [Compare Source](https://redirect.github.com/golangci/golangci-lint-action/compare/v9.1.0...v9.2.0) <!-- Release notes generated using configuration in .github/release.yml at v9.2.0 --> #### What's Changed ##### Changes - feat: add version-file option by [@​ldez](https://redirect.github.com/ldez) in [#​1320](https://redirect.github.com/golangci/golangci-lint-action/pull/1320) - chore: move samples into fixtures by [@​ldez](https://redirect.github.com/ldez) in [#​1321](https://redirect.github.com/golangci/golangci-lint-action/pull/1321) ##### Dependencies - build(deps-dev): bump the dev-dependencies group with 2 updates by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​1317](https://redirect.github.com/golangci/golangci-lint-action/pull/1317) - build(deps): bump actions/checkout from 5 to 6 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​1318](https://redirect.github.com/golangci/golangci-lint-action/pull/1318) - build(deps-dev): bump the dev-dependencies group with 3 updates by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​1323](https://redirect.github.com/golangci/golangci-lint-action/pull/1323) - build(deps): bump yaml from 2.8.1 to 2.8.2 in the dependencies group by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​1324](https://redirect.github.com/golangci/golangci-lint-action/pull/1324) **Full Changelog**: <golangci/golangci-lint-action@v9.1.0...v9.2.0> ### [`v9.1.0`](https://redirect.github.com/golangci/golangci-lint-action/releases/tag/v9.1.0) [Compare Source](https://redirect.github.com/golangci/golangci-lint-action/compare/v9.0.0...v9.1.0) <!-- Release notes generated using configuration in .github/release.yml at v9.1.0 --> #### What's Changed ##### Changes - feat: automatic module directories by [@​ldez](https://redirect.github.com/ldez) in [#​1315](https://redirect.github.com/golangci/golangci-lint-action/pull/1315) ##### Documentation - docs: organize options by [@​ldez](https://redirect.github.com/ldez) in [#​1314](https://redirect.github.com/golangci/golangci-lint-action/pull/1314) ##### Dependencies - build(deps-dev): bump the dev-dependencies group with 2 updates by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​1307](https://redirect.github.com/golangci/golangci-lint-action/pull/1307) - build(deps-dev): bump js-yaml from 4.1.0 to 4.1.1 by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​1309](https://redirect.github.com/golangci/golangci-lint-action/pull/1309) - build(deps-dev): bump the dev-dependencies group with 2 updates by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​1310](https://redirect.github.com/golangci/golangci-lint-action/pull/1310) - build(deps): bump the dependencies group with 2 updates by [@​dependabot](https://redirect.github.com/dependabot)\[bot] in [#​1311](https://redirect.github.com/golangci/golangci-lint-action/pull/1311) **Full Changelog**: <golangci/golangci-lint-action@v9.0.0...v9.1.0> ### [`v9.0.0`](https://redirect.github.com/golangci/golangci-lint-action/releases/tag/v9.0.0) [Compare Source](https://redirect.github.com/golangci/golangci-lint-action/compare/v8.0.0...v9.0.0) In the scope of this release, we change Nodejs runtime from node20 to node24 (<https://github.blog/changelog/2025-09-19-deprecation-of-node-20-on-github-actions-runners/>). #### What's Changed ##### Changes - feat: add install-only option by [@​ldez](https://redirect.github.com/ldez) in [#​1305](https://redirect.github.com/golangci/golangci-lint-action/pull/1305) - feat: support Module Plugin System by [@​ldez](https://redirect.github.com/ldez) in [#​1306](https://redirect.github.com/golangci/golangci-lint-action/pull/1306) **Full Changelog**: <golangci/golangci-lint-action@v8.0.0...v9.0.0> </details> --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/genai-toolbox). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS4xNTkuNCIsInVwZGF0ZWRJblZlciI6IjQyLjQyLjIiLCJ0YXJnZXRCcmFuY2giOiJtYWluIiwibGFiZWxzIjpbXX0=--> Co-authored-by: Yuan Teoh <[email protected]>
…en/getting-started/quickstart/go/genkit (googleapis#1999) Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.43.0 to 0.45.0. <details> <summary>Commits</summary> <ul> <li><a href="https://github.com/golang/crypto/commit/4e0068c0098be10d7025c99ab7c50ce454c1f0f9"><code>4e0068c</code></a> go.mod: update golang.org/x dependencies</li> <li><a href="https://github.com/golang/crypto/commit/e79546e28b85ea53dd37afe1c4102746ef553b9c"><code>e79546e</code></a> ssh: curb GSSAPI DoS risk by limiting number of specified OIDs</li> <li><a href="https://github.com/golang/crypto/commit/f91f7a7c31bf90b39c1de895ad116a2bacc88748"><code>f91f7a7</code></a> ssh/agent: prevent panic on malformed constraint</li> <li><a href="https://github.com/golang/crypto/commit/2df4153a0311bdfea44376e0eb6ef2faefb0275b"><code>2df4153</code></a> acme/autocert: let automatic renewal work with short lifetime certs</li> <li><a href="https://github.com/golang/crypto/commit/bcf6a849efcf4702fa5172cb0998b46c3da1e989"><code>bcf6a84</code></a> acme: pass context to request</li> <li><a href="https://github.com/golang/crypto/commit/b4f2b62076abeee4e43fb59544dac565715fbf1e"><code>b4f2b62</code></a> ssh: fix error message on unsupported cipher</li> <li><a href="https://github.com/golang/crypto/commit/79ec3a51fcc7fbd2691d56155d578225ccc542e2"><code>79ec3a5</code></a> ssh: allow to bind to a hostname in remote forwarding</li> <li><a href="https://github.com/golang/crypto/commit/122a78f140d9d3303ed3261bc374bbbca149140f"><code>122a78f</code></a> go.mod: update golang.org/x dependencies</li> <li><a href="https://github.com/golang/crypto/commit/c0531f9c34514ad5c5551e2d6ce569ca673a8afd"><code>c0531f9</code></a> all: eliminate vet diagnostics</li> <li><a href="https://github.com/golang/crypto/commit/0997000b45e3a40598272081bcad03ffd21b8adb"><code>0997000</code></a> all: fix some comments</li> <li>Additional commits viewable in <a href="https://github.com/golang/crypto/compare/v0.43.0...v0.45.0">compare view</a></li> </ul> </details> <br /> [](https://docs.github.com/en/github/managing-security-vulnerabilities/about-dependabot-security-updates#about-compatibility-scores) Dependabot will resolve any conflicts with this PR as long as you don't alter it yourself. You can also trigger a rebase manually by commenting `@dependabot rebase`. [//]: # (dependabot-automerge-start) [//]: # (dependabot-automerge-end) --- <details> <summary>Dependabot commands and options</summary> <br /> You can trigger Dependabot actions by commenting on this PR: - `@dependabot rebase` will rebase this PR - `@dependabot recreate` will recreate this PR, overwriting any edits that have been made to it - `@dependabot merge` will merge this PR after your CI passes on it - `@dependabot squash and merge` will squash and merge this PR after your CI passes on it - `@dependabot cancel merge` will cancel a previously requested merge and block automerging - `@dependabot reopen` will reopen this PR if it is closed - `@dependabot close` will close this PR and stop Dependabot recreating it. You can achieve the same result by closing it manually - `@dependabot show <dependency name> ignore conditions` will show all of the ignore conditions of the specified dependency - `@dependabot ignore this major version` will close this PR and stop Dependabot creating any more for this major version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this minor version` will close this PR and stop Dependabot creating any more for this minor version (unless you reopen the PR or upgrade to it yourself) - `@dependabot ignore this dependency` will close this PR and stop Dependabot creating any more for this dependency (unless you reopen the PR or upgrade to it yourself) You can disable automated security fix PRs for this repo from the [Security Alerts page](https://github.com/googleapis/genai-toolbox/network/alerts). </details> Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Yuan Teoh <[email protected]>
This PR contains the following updates: | Package | Type | Update | Change | |---|---|---|---| | [actions/setup-node](https://redirect.github.com/actions/setup-node) ([changelog](https://redirect.github.com/actions/setup-node/compare/2028fbc5c25fe9cf00d9f06a71cc4710d4507903..395ad3262231945c25e8478fd5baf05154b1d79f)) | action | digest | `2028fbc` -> `395ad32` | | [lycheeverse/lychee-action](https://redirect.github.com/lycheeverse/lychee-action) | action | pinDigest | -> `a8c4c7c` | --- ### Configuration 📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined). 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 👻 **Immortal**: This PR will be recreated if closed unmerged. Get [config help](https://redirect.github.com/renovatebot/renovate/discussions) if that's undesired. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR was generated by [Mend Renovate](https://mend.io/renovate/). View the [repository job log](https://developer.mend.io/github/googleapis/genai-toolbox). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0Mi4xOS45IiwidXBkYXRlZEluVmVyIjoiNDIuNTkuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->
967d0cb to
955bb87
Compare
Description
Added capability to config hardcoded variable listed below
MaxOpenConns
MaxIdleConns
ConnMaxLifetime
PR Checklist
CONTRIBUTING.md
Hardcoded Connection Pool Configurations #2243
!if this involve a breaking change🛠️ Fixes #2243