You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by "andrijapanicsb (via GitHub)" <gi...@apache.org> on 2026/06/10 21:47:29 UTC

[PR] server: make HikariCP leak detection configurable [cloudstack]

andrijapanicsb opened a new pull request, #13394:
URL: https://github.com/apache/cloudstack/pull/13394

   # server: make HikariCP leak detection configurable
   
   ## Summary
   
   This change adds optional CloudStack management-server database settings for HikariCP leak detection and JMX MBean registration.
   
   - Add `db.cloud.leakDetectionThreshold` support and map it to `HikariConfig#setLeakDetectionThreshold(long)`.
   - Add `db.cloud.registerMbeans` support and map it to `HikariConfig#setRegisterMbeans(boolean)`.
   - Keep both settings disabled by default.
   - Document disabled-by-default examples in `client/conf/db.properties.in`.
   
   ## Motivation
   
   Operators debugging management-server DB pool exhaustion need a runtime-configurable way to identify code paths that borrow JDBC connections and do not return them quickly enough. HikariCP already supports leak-detection stack traces and JMX pool counters, but CloudStack did not expose those options through `db.properties`.
   
   These settings make it possible to enable leak diagnostics temporarily during investigation without hard-coding a threshold or changing production defaults.
   
   ## Implementation
   
   - Parse `db.cloud.leakDetectionThreshold` as an optional long value alongside the existing cloud DB pool tuning properties.
   - Parse `db.cloud.registerMbeans` as an optional boolean value.
   - Pass the new values only into the HikariCP datasource configuration path.
   - Leave DBCP behavior unchanged.
   - Apply effective defaults of `0` for leak detection and `false` for MBean registration.
   - Log the effective HikariCP debug settings at debug level without logging credentials or connection secrets.
   - Add focused `TransactionLegacyTest` coverage for absent, disabled, enabled leak-detection, and enabled MBean settings.
   - Update existing URI assertions to include the current `TransactionLegacy.CONNECTION_PARAMS` suffix.
   
   ## Testing
   
   Ran the following validation:
   
   ```text
   git diff --check
   git grep -n "leakDetectionThreshold\|registerMbeans" -- .
   mvn -pl framework/db -am -Dtest=TransactionLegacyTest -DfailIfNoTests=false "-Dsurefire.failIfNoSpecifiedTests=false" test
   mvn -pl framework/db -am -DskipTests compile
   ```
   
   Results:
   
   - `git diff --check` passed.
   - `TransactionLegacyTest` passed with 12 tests, 0 failures.
   - `framework/db` compile passed.
   
   ## Runtime Usage
   
   To enable leak diagnostics after deploying a package built from this branch, set the following in `/etc/cloudstack/management/db.properties`:
   
   ```properties
   db.cloud.leakDetectionThreshold=60000
   db.cloud.registerMbeans=true
   ```
   
   Then restart the management server:
   
   ```bash
   systemctl restart cloudstack-management
   ```
   
   During reproduction, inspect the management-server log for HikariCP leak-detection output:
   
   ```bash
   grep -i "leak detection\|Apparent connection leak\|ProxyLeakTask\|Hikari" /var/log/cloudstack/management/management-server.log
   ```
   
   Signed-off-by: andrijapanicsb <an...@gmail.com>
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] server: make HikariCP leak detection configurable [cloudstack]

Posted by "andrijapanicsb (via GitHub)" <gi...@apache.org>.
andrijapanicsb closed pull request #13394: server: make HikariCP leak detection configurable
URL: https://github.com/apache/cloudstack/pull/13394


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [PR] server: make HikariCP leak detection configurable [cloudstack]

Posted by "codecov[bot] (via GitHub)" <gi...@apache.org>.
codecov[bot] commented on PR #13394:
URL: https://github.com/apache/cloudstack/pull/13394#issuecomment-4674986513

   ## [Codecov](https://app.codecov.io/gh/apache/cloudstack/pull/13394?dropdown=coverage&src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) Report
   :white_check_mark: All modified and coverable lines are covered by tests.
   :white_check_mark: Project coverage is 3.69%. Comparing base ([`348ce95`](https://app.codecov.io/gh/apache/cloudstack/commit/348ce953a99246a756b527994f7745a7be038234?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)) to head ([`a8812cf`](https://app.codecov.io/gh/apache/cloudstack/commit/a8812cf023206ef518f0f310addf1285545b6ff9?dropdown=coverage&el=desc&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache)).
   :warning: Report is 12 commits behind head on 4.22.
   > :exclamation:  There is a different number of reports uploaded between BASE (348ce95) and HEAD (a8812cf). Click for more details.
   > 
   > <details><summary>HEAD has 3 uploads less than BASE</summary>
   >
   >| Flag | BASE (348ce95) | HEAD (a8812cf) |
   >|------|------|------|
   >|uitests|2|1|
   >|unittests|2|0|
   ></details>
   
   <details><summary>Additional details and impacted files</summary>
   
   
   
   ```diff
   @@              Coverage Diff              @@
   ##               4.22   #13394       +/-   ##
   =============================================
   - Coverage     17.68%    3.69%   -13.99%     
   =============================================
     Files          5922      448     -5474     
     Lines        533123    38105   -495018     
     Branches      65201     7059    -58142     
   =============================================
   - Hits          94268     1409    -92859     
   + Misses       428212    36509   -391703     
   + Partials      10643      187    -10456     
   ```
   
   | [Flag](https://app.codecov.io/gh/apache/cloudstack/pull/13394/flags?src=pr&el=flags&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | Coverage Δ | |
   |---|---|---|
   | [uitests](https://app.codecov.io/gh/apache/cloudstack/pull/13394/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `3.69% <ø> (ø)` | |
   | [unittests](https://app.codecov.io/gh/apache/cloudstack/pull/13394/flags?src=pr&el=flag&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache) | `?` | |
   
   Flags with carried forward coverage won't be shown. [Click here](https://docs.codecov.io/docs/carryforward-flags?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache#carryforward-flags-in-the-pull-request-comment) to find out more.
   </details>
   
   [:umbrella: View full report in Codecov by Harness](https://app.codecov.io/gh/apache/cloudstack/pull/13394?dropdown=coverage&src=pr&el=continue&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).   
   :loudspeaker: Have feedback on the report? [Share it here](https://about.codecov.io/codecov-pr-comment-feedback/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=apache).
   <details><summary> :rocket: New features to boost your workflow: </summary>
   
   - :snowflake: [Test Analytics](https://docs.codecov.com/docs/test-analytics): Detect flaky tests, report on failures, and find test suite problems.
   - :package: [JS Bundle Analysis](https://docs.codecov.com/docs/javascript-bundle-analysis): Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
   </details>


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@cloudstack.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org