-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
feat(cli): Handle reload based on referenced file change #22539
Merged
Merged
Changes from 15 commits
Commits
Show all changes
18 commits
Select commit
Hold shift + click to select a range
2c309f3
feat(watch tls files) Add http sink tls cert/key to config::watcher
gllb 8cc8f7e
Update changelog.d/22386_extend_watcher_paths.enhancement.md
gllb 8d6310d
feat(watch tls file) Add ComponentConfig to let watcher find components
gllb ad9d0e8
feat(watch tls file) Let watcher send ReloadComponent signal
gllb cf0a9dd
feat(watch tls file) handle ReloadComponent signal
gllb 8b491c6
feat(watch tls file) Ensure signal is sent once in case of ReloadComp…
gllb ecee69c
(feat reload components) Handle Vec<ComponentKey> instead of single one
gllb 0b58423
Merge remote-tracking branch 'origin/master' into gllb/master
pront c3c8968
cargo fmt
pront 95df0da
Update changelog.d/22386_extend_watcher_paths.enhancement.md
gllb 5811fd8
Update src/config/mod.rs
gllb d67394c
Fix missing enclosed delimiter
gllb 214cce4
solve clippy issues
gllb 8ef872a
cargo fmt
gllb 14ace20
Merge remote-tracking branch 'origin/master' into gllb/master
pront 6452ef6
Fix testing
gllb c9330e7
run cargo fmt
gllb cc64987
add dedicated watcher test
gllb File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
The TLS `crt_file` and `key_file` from `http` sinks are now watched when `--watch_config` is enabled and therefore changes to those files will trigger a config reload without the need to restart Vector. | ||
|
||
authors: gllb |
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
This file contains 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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Some implementation details:
component_keys
(or whatever struct we end up with) as a newRunningTopology
field to avoid passing them around to all these functions.async fn shutdown_diff(...)
src/config/diff.rs
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the
component_keys
here are passed when a change is detected from the watcher. If we use it as a field ofRunningTopology
then it supposed to be empty almost all the time, except when a change is detected. Which will still imply passing it inreload_config_and_respawn
anyway, right ? or maybe I don't get it ?For the notion of watched paths change in configDiff I think I see what you mean.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@pront So I did implement this logic in configDiff, and it does what it should. Only this part : https://github.com/gllb/vector/blob/master/src/topology/running.rs#L490-L509 is causing the sink to be re-used and therefore it is not reloaded.
On the implementation where all is done inside
shutdown_diff
its easy to work around it as I can append tosink_to_change
after so the reuse buffer code doesnt even know about it. But since its in configDiff now, I dont see how to work around it, any idea ?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could remove this part, but I dont know if its safe to do or not.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Glad we agree on the
src/config/diff.rs
enhancement.What is more important is how to keep track of the component type. I don't think we have an enum or something to model currently. But we probably to keep associate a
ComponentKey
with a newComponentType
. Talking about this, I realize it might be better to do this in a followup PR since it might need some discussion.Correct. It will be empty until the watcher detects a file change, then it will push it there. When we process/reload, it will clear the whole thing. I am a bit ambivalent on this, so feel free to TIOLI.
To be clear, I was proposing adding it here:
vector/src/topology/running.rs
Line 41 in 7644658
The reload_config_and_respawn will then have access to it via
self
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ok I can create follow up PR for it but not sure I will have a lot of time for it, lets see. I still have no idea about the struggle with reuse buffer code I pointed out in
shutdown_diff
but I will open a PR with what I have, so anybody can contribute as well.