You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@doris.apache.org by "Hastyshell (via GitHub)" <gi...@apache.org> on 2026/02/09 09:14:59 UTC

[PR] [fix](bdbje) release SSL certificate monitor threads on factory shutdown [doris-thirdparty]

Hastyshell opened a new pull request, #380:
URL: https://github.com/apache/doris-thirdparty/pull/380

   Summary
   This PR fixes a thread leak of `BDB-SSL-Certificate-Monitor` in SSL/TLS mode.
   In some production scenarios, short-lived admin/ping/channel-factory objects are created repeatedly, but their internal certificate-monitor scheduler threads are not released. This causes monitor threads to accumulate over time.
    Root Cause
   - `SSLChannelFactory` creates a dedicated scheduled executor for certificate monitoring.
   - The channel factory lacked a unified lifecycle shutdown contract at the interface level.
   - Some call paths (including admin/ping utility paths) did not release internally created factories.
   - Certificate monitoring could be initialized even when PEM monitoring preconditions were not fully met.
    Changes
   - Add `shutdown()` default lifecycle hook to `DataChannelFactory` (no-op by default for compatibility).
   - Ensure `SSLChannelFactory.shutdown()` is invoked on major shutdown paths:
     - `RepImpl` close/abnormal-close paths
     - `Monitor.shutdown()`
   - Add ownership-aware close handling:
     - `ReplicationGroupAdmin.close()`
     - `DbPing.close()`
     - `DbGroupAdmin` now closes `ReplicationGroupAdmin` in `finally`
   - Tighten SSL cert monitor initialization:
     - Start monitor only when PEM cert/key/CA are fully configured
     - Skip monitor setup for keystore mode or incomplete PEM config
    Expected Result
   - `BDB-SSL-Certificate-Monitor` threads no longer grow linearly with repeated admin/ping/factory creation.
   - Existing non-SSL and simple channel factory behavior remains compatible due to default no-op shutdown contract.
    Validation
   - Code-level verification of all factory ownership and shutdown paths.
   - Build attempt in current environment is blocked by Maven PKIX trust-chain issue when downloading plugins (environmental, not code-logic related).


-- 
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@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org


Re: [PR] [fix](bdbje) release SSL certificate monitor threads on factory shutdown [doris-thirdparty]

Posted by "gavinchou (via GitHub)" <gi...@apache.org>.
gavinchou merged PR #380:
URL: https://github.com/apache/doris-thirdparty/pull/380


-- 
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@doris.apache.org

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


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@doris.apache.org
For additional commands, e-mail: commits-help@doris.apache.org