-
Notifications
You must be signed in to change notification settings - Fork 512
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
Hot configuration reload #633
Comments
I actually had this in a very early version and tore it out because we didn't need it and it added a lot of complexity. I think it would be great to add and if you'd like to take that on it would be appreciated. |
I completely agree with you that it may cause a lot of unnecessary complexity especially when we want to hot reload everything. I'll send you a draft some day later. |
To implement this, maybe we could:
|
At a simpler level, it would be acceptable to send a signal to the running application to tell it to reload the configuration. I'd probably approach this in 3 steps, with the final one being optional:
In 2 and 3 it's important to cleanly handle a bad configuration. The previous server should be left running until we've done as much work as possible to ensure a new server can be started to take its place. |
by (3), maybe the latest viper can do that. There is a handler viper.OnConfigChange() to watch the events when configuration changed, it was supported by "github.com/fsnotify/fsnotify". Since we use viper, we needn't to reinvent the wheel if certain conditions are met, I'll take a deeper look into it. |
Yeah, I saw your PR updating viper. Kind of disappointed how many files that adds to support one simple use case but I agree, we shouldn't waste time building it ourselves. |
yeah, too many additional files |
Have talked to some colleague again, I think maybe we are a little bit over-designed about this feature. Hot reload the debug level is more important than the other configuration items for them , because the log level will be set to default as For other configuration, like the TLS, it's quite enough to shut down the relative node and reboot another one as long as it can be done gracefully. So I think maybe the graceful shutdown signer and server are the one which should be in our roadmap? Thoughts? @endophage @cyli @riyazdf |
That definitely makes sense. I'd suggest using |
sure, closing |
Hi there,
Recently, I'm working on the hot configuration reload on some of our projects. I wonder if Notary need this feature as well?
One scenario is: when in production, the log should not be set as
debug
, but when something bad happens, the Ops may want some more detail via log on the debug level. Since they couldn't stop the running process, they wish to have the feature of hot reloading.The text was updated successfully, but these errors were encountered: