HIVE-29636: Add SSL keystore auto-reloading for HiveServer2 WebUI#6514
Open
magnuma3 wants to merge 1 commit into
Open
HIVE-29636: Add SSL keystore auto-reloading for HiveServer2 WebUI#6514magnuma3 wants to merge 1 commit into
magnuma3 wants to merge 1 commit into
Conversation
|
deniskuzZ
reviewed
May 29, 2026
| private Server webServer; | ||
| private QueuedThreadPool threadPool; | ||
| private PortHandlerWrapper portHandlerWrapper; | ||
| private Optional<Timer> configurationChangeMonitor = Optional.empty(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



HIVE-29636
What changes were proposed in this pull request?
HiveServer2 WebUI's SslContextFactory is built once at startup, so renewing the SSL keystore requires restarting HS2
Watch the keystore file with Hadoop's FileMonitoringTimerTask and call SslContextFactory#reload(...) on mtime change. The daemon Timer is installed when SSL is on and is cancelled in HttpServer#stop(). Reload failures are logged and swallowed
Same pattern as HADOOP-16524, reusing its FileMonitoringTimerTask
Why are the changes needed?
Rotating WebUI SSL certificates currently requires an HS2 restart, which is increasingly painful as certificate lifetimes shorten. Hadoop's HttpServer2 already solved this via HADOOP-16524.
Does this PR introduce any user-facing change?
Yes — new opt-in ConfVar hive.server2.webui.keystore.reload.interval (default 60s, 0 disables). When the keystore file changes, the running HS2 picks up the new certificate within the interval; no restart needed. No API or schema changes.
How was this patch tested?
Added TestHttpServer