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
conf-parse: make config_parse_many() optionally save 'struct stat' for each file #21114
Conversation
This works as a resolution for #21113 |
Currently, systemd only uses the timestamp of the most recent file for tracking changes to configurations. With multiple drop-in files this results in reloads not picking up changes to older files. This patch fixes the reload behavior. Issue: systemd/systemd#21113 In-Review: systemd/systemd#21114 Change-Id: I9b92995e0d7faa612b51bfd45dd33803cd566441 Signed-off-by: William A. Kennington III <wak@google.com>
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.
lgtm, just some nitpicking about a function name
@@ -580,6 +580,28 @@ int network_load(Manager *manager, OrderedHashmap **networks) { | |||
return 0; | |||
} | |||
|
|||
static bool stats_by_path_equal(Hashmap *a, Hashmap *b) { |
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.
is "equal" really the right name for this? maybe "_unmodified"?
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.
For me, "equal" sounds suitable for "stats", and "unmodified" sounds suitable for "file" (or "path").
So, I prefer "equal" here. But not strong opinion. If you or others prefer "unmodified", then I will rename it.
@poettering Thank you for you review. I'd like to keep the function name at least in this PR. I am planning the Hashmap introduced in this PR make also used in PID1. So, I will re-consider the function name if it can be reused and moved to e.g. stat-util.[ch]. Merging. |
Currently, systemd only uses the timestamp of the most recent file for tracking changes to configurations. With multiple drop-in files this results in reloads not picking up changes to older files. This patch fixes the reload behavior. Issue: systemd/systemd#21113 In-Review: systemd/systemd#21114 Change-Id: I9b92995e0d7faa612b51bfd45dd33803cd566441 Signed-off-by: William A. Kennington III <wak@google.com>
Fixes #21113.