Skip to content
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

HIVE-28749: The default hikaricp.leakDetectionThreshold is not valid #5639

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

okumin
Copy link
Contributor

@okumin okumin commented Feb 9, 2025

What changes were proposed in this pull request?

HicariConfig's leak detection threshold has to be smaller than the max lifetime. Our default leak detection threshold is greater than the maximum lifetime defined on the HikariCP side and is disabled by default. Please check the JIRA for details.

https://issues.apache.org/jira/browse/HIVE-28749

Why are the changes needed?

Make our default value effective.

Does this PR introduce any user-facing change?

No.

Is the change a dependency upgrade?

No.

How was this patch tested?

  • I verified the warning disappears with default configurations
  • I tested hikaricp.maxLifetime was configurable in my local machine

Copy link

sonarqubecloud bot commented Feb 9, 2025

@@ -55,6 +56,7 @@ public DataSource create(Configuration hdpConfig, int maxPoolSize) throws SQLExc
Properties properties = replacePrefix(
DataSourceProvider.getPrefixedProperties(hdpConfig, HIKARI));
long connectionTimeout = hdpConfig.getLong(CONNECTION_TIMEOUT_PROPERTY, 30000L);
long maxLifetime = hdpConfig.getLong(MAX_LIFETIME, 3600000L);
Copy link
Member

Choose a reason for hiding this comment

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

what if the max lifetime is equal to the leak detection, will the rule for leak detection not take effect as the max lifetime takes first?
To me, the default of LEAK_DETECTION_THRESHOLD is too long, we can turn down this value, what do you think?

Copy link
Member

@zabetak zabetak Feb 10, 2025

Choose a reason for hiding this comment

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

If we add MAX_LIFETIME then we are adding a new config toggle that was not available before. I am not against doing it but it seems like independent of the main purpose of the PR.

Regarding the value of the threshold I agree with @dengzhhu653 that 1h is probably too long and it makes sense to lower it. In fact, since it is a debug property maybe we should keep it disabled by default (i.e., 0). I don't know how easy it is to pick a value that is useful in every use-case of the metastore.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants