Skip to content

Conversation

@2dmurali
Copy link
Contributor

@2dmurali 2dmurali commented Nov 18, 2025

Description

Fixes #16979

Problem

The RenewableTlsUtils prevents JVM shutdown in on-demand processes (e.g., Pinot Admin commands). Background threads monitoring SSL certificates used non-daemon threads, keeping the JVM alive indefinitely after process completion, requiring manual termination.

Fix

  • Modified NamedThreadFactory usage in RenewableTlsUtils to create daemon threads by passing true as the second constructor argument
  • Updated reloadSslFactoryWhenFileStoreChanges and reloadSslFactory methods to use NamedThreadFactory with daemon flag enabled.

@2dmurali 2dmurali marked this pull request as ready for review November 18, 2025 07:17
@xiangfu0 xiangfu0 requested a review from Copilot November 18, 2025 19:54
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

Fixes an issue where non-daemon background threads in RenewableTlsUtils prevented JVM shutdown in on-demand processes like Pinot Admin commands. The fix modifies NamedThreadFactory to support daemon thread creation and updates SSL certificate monitoring threads to use daemon mode.

Key changes:

  • Enhanced NamedThreadFactory with an optional daemon parameter to control thread daemon status
  • Updated SSL certificate file watcher and daily reload threads to use daemon threads
  • Applied the same fix to test code for consistency

Reviewed Changes

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

File Description
pinot-common/src/main/java/org/apache/pinot/common/utils/NamedThreadFactory.java Added daemon parameter support to enable creating daemon threads
pinot-common/src/main/java/org/apache/pinot/common/utils/tls/RenewableTlsUtils.java Updated SSL monitoring threads to use daemon mode via NamedThreadFactory
pinot-common/src/test/java/org/apache/pinot/common/utils/tls/RenewableTlsUtilsTest.java Applied daemon thread configuration to test executor service

@codecov-commenter
Copy link

codecov-commenter commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 63.20%. Comparing base (3224ce6) to head (494149c).
⚠️ Report is 23 commits behind head on master.

Additional details and impacted files
@@             Coverage Diff              @@
##             master   #17221      +/-   ##
============================================
+ Coverage     63.17%   63.20%   +0.03%     
  Complexity     1428     1428              
============================================
  Files          3121     3123       +2     
  Lines        184814   184835      +21     
  Branches      28332    28323       -9     
============================================
+ Hits         116760   116829      +69     
+ Misses        59033    58995      -38     
+ Partials       9021     9011      -10     
Flag Coverage Δ
custom-integration1 100.00% <ø> (ø)
integration 100.00% <ø> (ø)
integration1 100.00% <ø> (ø)
integration2 0.00% <ø> (ø)
java-11 63.17% <100.00%> (+0.01%) ⬆️
java-21 63.16% <100.00%> (+0.01%) ⬆️
temurin 63.20% <100.00%> (+0.03%) ⬆️
unittests 63.20% <100.00%> (+0.03%) ⬆️
unittests1 55.97% <100.00%> (+0.02%) ⬆️
unittests2 33.70% <66.66%> (+<0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@xiangfu0
Copy link
Contributor

Thanks for your contribution !

@xiangfu0 xiangfu0 merged commit 325446c into apache:master Nov 19, 2025
18 checks passed
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.

RenewableTlsUtils starting two non-daemon threads

3 participants