Skip to content

Conversation

@makikorp
Copy link
Contributor

…ources.xml

@makikorp makikorp requested a review from Copilot November 12, 2025 20:00
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR adds environment variable configuration support for OpenNMS database connection pool settings in the initialization script. Previously, most connection pool parameters were hardcoded; now they can be configured via environment variables.

Key Changes:

  • Added environment variables for database connection pool configuration (idle timeout, login timeout, min pool, max pool, max size)
  • Applied these configurable parameters to all three database connection configurations in opennms-datasources.xml
  • Bumped chart version from 1.1.20 to 1.1.21

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
horizon/scripts/onms-core-init.sh Added environment variable defaults and applied them to database connection pool configurations in opennms-datasources.xml
horizon/Chart.yaml Incremented chart version to reflect the configuration changes

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

# Defaults
OPENNMS_DATABASE_CONNECTION_IDLETIMEOUT="${OPENNMS_DATABASE_CONNECTION_IDLETIMEOUT:-600}"
OPENNMS_DATABASE_CONNECTION_LOGINTIMEOUT="${OPENNMS_DATABASE_CONNECTION_LOGINTIMEOUT:-3}"
OPENNMS_DATABASE_CONNECTION_MINPOOL="${OPENNMS_DATABASE_CONNECTION_MAXSIZE:-25}"
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The MINPOOL variable is incorrectly using MAXSIZE as its source. It should use OPENNMS_DATABASE_CONNECTION_MINPOOL instead: OPENNMS_DATABASE_CONNECTION_MINPOOL=\"${OPENNMS_DATABASE_CONNECTION_MINPOOL:-25}\"

Suggested change
OPENNMS_DATABASE_CONNECTION_MINPOOL="${OPENNMS_DATABASE_CONNECTION_MAXSIZE:-25}"
OPENNMS_DATABASE_CONNECTION_MINPOOL="${OPENNMS_DATABASE_CONNECTION_MINPOOL:-25}"

Copilot uses AI. Check for mistakes.
@makikorp makikorp self-assigned this Nov 12, 2025
@makikorp makikorp requested a review from Copilot November 12, 2025 20:20
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

maxPool="10"
maxSize="50" />
<connection-pool idleTimeout="${OPENNMS_DATABASE_CONNECTION_IDLETIMEOUT}"
minPool="${OPENNMS_DATABASE_CONNECTION_MINPOOL}"
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The minPool values for template1 and postgres datasources are now set to 25 (from the default), but were previously hardcoded to 0. This changes the behavior of these connection pools and may cause resource consumption issues. Consider using a separate environment variable for these datasources or documenting this breaking change.

Copilot uses AI. Check for mistakes.
maxPool="10"
maxSize="50" />
<connection-pool idleTimeout="${OPENNMS_DATABASE_CONNECTION_IDLETIMEOUT}"
minPool="${OPENNMS_DATABASE_CONNECTION_MINPOOL}"
Copy link

Copilot AI Nov 12, 2025

Choose a reason for hiding this comment

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

The minPool values for template1 and postgres datasources are now set to 25 (from the default), but were previously hardcoded to 0. This changes the behavior of these connection pools and may cause resource consumption issues. Consider using a separate environment variable for these datasources or documenting this breaking change.

Copilot uses AI. Check for mistakes.
@makikorp makikorp assigned indigo423 and unassigned makikorp Nov 12, 2025
@makikorp makikorp requested a review from indigo423 November 12, 2025 21:52
@makikorp makikorp assigned makikorp and indigo423 and unassigned indigo423 Nov 12, 2025
@makikorp makikorp removed their assignment Nov 25, 2025
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.

2 participants