Skip to content

Conversation

@ankurg03
Copy link

@ankurg03 ankurg03 commented Dec 29, 2025

Description

Added capability to config hardcoded variable listed below
MaxOpenConns
MaxIdleConns
ConnMaxLifetime

PR Checklist

  • [Done ] Make sure you reviewed
    CONTRIBUTING.md
  • [Done] Make sure to open an issue as a
    Hardcoded Connection Pool Configurations #2243
  • [Done] Ensure the tests and linter pass
  • [Done] Code coverage does not decrease (if any source code was changed)
  • [Done] Appropriate docs were updated (if necessary)
  • [No Breaking changes ] Make sure to add ! if this involve a breaking change

🛠️ Fixes #2243

@ankurg03 ankurg03 requested a review from a team as a code owner December 29, 2025 12:36
@google-cla
Copy link

google-cla bot commented Dec 29, 2025

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.

@gemini-code-assist
Copy link
Contributor

Summary of Changes

Hello @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 MaxOpenConns, MaxIdleConns, and ConnMaxLifetime in their YAML configurations, providing greater control over database connection behavior and resource management. This change improves the flexibility and adaptability of the ClickHouse integration.

Highlights

  • Configurable Connection Pool Settings: Introduced the ability to configure MaxOpenConns, MaxIdleConns, and ConnMaxLifetime for ClickHouse connections via YAML, moving these from hardcoded values to user-definable parameters.
  • Default Values and Validation: Established default values for connection pool settings and implemented logic to use these defaults if no custom values are provided. Added validation for ConnMaxLifetime to ensure it is a valid duration string.
  • Enhanced Test Coverage: Expanded the test suite to include new test cases for parsing the connection pool settings from YAML and verifying the correct application and error handling of these settings within the ClickHouse connection initialization.

🧠 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 Assist

The 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 /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

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 .gemini/ folder in the base of the repository. Detailed instructions can be found here.

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

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a 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 initClickHouseConnectionPool function to accept the Config struct 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) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

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.

@ankurg03 ankurg03 changed the title Clickhouse configs #2243 Configurable Connection Pool Settings Dec 30, 2025
@ankurg03 ankurg03 changed the title #2243 Configurable Connection Pool Settings feat(tools/Clickhouse): configurable connection pool settings Dec 30, 2025
ankurg03 and others added 7 commits December 30, 2025 15:20
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
[@&#8203;ldez](https://redirect.github.com/ldez) in
[#&#8203;1320](https://redirect.github.com/golangci/golangci-lint-action/pull/1320)
- chore: move samples into fixtures by
[@&#8203;ldez](https://redirect.github.com/ldez) in
[#&#8203;1321](https://redirect.github.com/golangci/golangci-lint-action/pull/1321)

##### Dependencies

- build(deps-dev): bump the dev-dependencies group with 2 updates by
[@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in
[#&#8203;1317](https://redirect.github.com/golangci/golangci-lint-action/pull/1317)
- build(deps): bump actions/checkout from 5 to 6 by
[@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in
[#&#8203;1318](https://redirect.github.com/golangci/golangci-lint-action/pull/1318)
- build(deps-dev): bump the dev-dependencies group with 3 updates by
[@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in
[#&#8203;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 [@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in
[#&#8203;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
[@&#8203;ldez](https://redirect.github.com/ldez) in
[#&#8203;1315](https://redirect.github.com/golangci/golangci-lint-action/pull/1315)

##### Documentation

- docs: organize options by
[@&#8203;ldez](https://redirect.github.com/ldez) in
[#&#8203;1314](https://redirect.github.com/golangci/golangci-lint-action/pull/1314)

##### Dependencies

- build(deps-dev): bump the dev-dependencies group with 2 updates by
[@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in
[#&#8203;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
[@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in
[#&#8203;1309](https://redirect.github.com/golangci/golangci-lint-action/pull/1309)
- build(deps-dev): bump the dev-dependencies group with 2 updates by
[@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in
[#&#8203;1310](https://redirect.github.com/golangci/golangci-lint-action/pull/1310)
- build(deps): bump the dependencies group with 2 updates by
[@&#8203;dependabot](https://redirect.github.com/dependabot)\[bot] in
[#&#8203;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
[@&#8203;ldez](https://redirect.github.com/ldez) in
[#&#8203;1305](https://redirect.github.com/golangci/golangci-lint-action/pull/1305)
- feat: support Module Plugin System by
[@&#8203;ldez](https://redirect.github.com/ldez) in
[#&#8203;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 />


[![Dependabot compatibility
score](https://dependabot-badges.githubapp.com/badges/compatibility_score?dependency-name=golang.org/x/crypto&package-manager=go_modules&previous-version=0.43.0&new-version=0.45.0)](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==-->
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Hardcoded Connection Pool Configurations

3 participants