config-manager: reload TLS certificates when file content changes#460
Open
smoczy123 wants to merge 1 commit into
Open
config-manager: reload TLS certificates when file content changes#460smoczy123 wants to merge 1 commit into
smoczy123 wants to merge 1 commit into
Conversation
a1baa20 to
2b5098a
Compare
knowack1
requested changes
May 25, 2026
|
|
||
| // Monitor TLS certificate files for in-place content changes | ||
| let mut tls_monitor = TlsFileMonitor::new(&self.config_tx.borrow()); | ||
| let mut tls_check_interval = tokio::time::interval(TLS_FILE_CHECK_INTERVAL); |
Collaborator
There was a problem hiding this comment.
Shouldn't we use some filesystem mechanisms to watch files? Most likely, there is a crate available for this.
Collaborator
There was a problem hiding this comment.
There is such crate: https://crates.io/crates/notify but it needs quite a lot of integration (it is not async).
ewienik
requested changes
May 25, 2026
2b5098a to
1b373e9
Compare
Add periodic monitoring of TLS certificate file modification times (every 30 seconds) so that in-place cert rotation is detected without requiring SIGHUP or a path change. When a file change is detected, the config manager re-reads the cert/key files and pushes the updated HttpServerConfig through the watch channel, triggering a server reload. Fixes: VECTOR-550
1b373e9 to
bc22247
Compare
Collaborator
Author
|
Changelog:
|
knowack1
approved these changes
Jun 3, 2026
| } | ||
|
|
||
| /// Tracks TLS files to detect in-place content changes. | ||
| struct TlsFileMonitor { |
| } | ||
|
|
||
| /// Tracks TLS files to detect in-place content changes. | ||
| struct TlsFileMonitor { |
Collaborator
There was a problem hiding this comment.
Consider moving to dedicated file along with FileMonitor
|
|
||
| async fn read_content_hash(path: Option<&Path>) -> Option<u64> { | ||
| let path = path?; | ||
| let content = tokio::fs::read(path).await.ok()?; |
Collaborator
There was a problem hiding this comment.
I think we read these files twice (in tls.rs as well). On the other this is minor inefficiency with rare path and the design separation is clean.
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.
Add periodic monitoring of TLS certificate file modification times (every 30 seconds) so that in-place cert rotation is detected without requiring SIGHUP or a path change. When a file change is detected, the config manager re-reads the cert/key files and pushes the updated HttpServerConfig through the watch channel, triggering a server reload.
Fixes: VECTOR-550