[#541] Use default value if config param is unset after SIGHUP #541
Labels
No labels
P0
P1
P2
P3
good first issue
Infrastructure
blocked
bug
config
discussion
documentation
duplicate
enhancement
go
help wanted
internal
invalid
kludge
observability
perfomance
question
refactoring
wontfix
No project
No assignees
3 participants
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: TrueCloudLab/frostfs-s3-gw#541
Loading…
Reference in a new issue
No description provided.
Delete branch "mbiryukova/frostfs-s3-gw:feature/fix_sighup"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Signed-off-by: Marina Biryukova m.biryukova@yadro.com
1c8a9f2d5f
to574e50b6c3
[#xxx] Use default value if config param is unset after SIGHUPto [#541] Use default value if config param is unset after SIGHUP@ -1009,2 +1024,2 @@
if v.IsSet(cmdConfig) {
if err := readConfig(v); err != nil {
func readInConfig(cfg *appCfg) error {
if err := cfg.settings.MergeConfigMap(cfg.defaults.AllSettings()); err != nil {
This way we must set all default values (false, empty string, etc). It's easy to forget.
I suggest implement creating and filling new viper instance on SIGHUP and replace it under mutex. Something like that:
In this case, won’t we lose all default values and values that were set via flags after SIGHUP?
Well, then I suppose keep flags also (env variables not reloadable and new viper instance get them also)
574e50b6c3
toef946b02f0
Please, rebase
ef946b02f0
toefc6795fc5
efc6795fc5
tod99c1cf9d3
LGTM
View command line instructions
Checkout
From your project repository, check out a new branch and test the changes.