Fix SIGHUP - #4113
Conversation
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #4113 +/- ##
==========================================
- Coverage 27.26% 27.23% -0.03%
==========================================
Files 678 678
Lines 46301 46347 +46
==========================================
Hits 12622 12622
- Misses 32461 32507 +46
Partials 1218 1218 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
roman-khimov
left a comment
There was a problem hiding this comment.
Create an issue for neofs-testcases to test these scenarios.
| return fmt.Errorf("read configuration: %w", err) | ||
| } | ||
| if err := validateConfig(newCfg); err != nil { | ||
| return fmt.Errorf("validate configuration: %w", err) |
There was a problem hiding this comment.
not sure if running with an incorrect config is ok. maybe app should die? the only feedback we have there is log message, otherwise: app is healthy, and systemd thinks we are "Ready"
There was a problem hiding this comment.
Aren't we running with an old config in this case?
There was a problem hiding this comment.
yes, but we have a new config file (envs), and the app is still running with already unknown old config
There was a problem hiding this comment.
Agree. A failed reload can leave the runtime state out of sync with the configuration, so reporting READY=1 is misleading. I think stopping the node on reload failure would be a good idea.
Build replacement gRPC servers and bind newly added endpoints before stopping existing servers. This keeps the current Public API available when the new TLS configuration is invalid or a new endpoint is occupied. Track the configuration snapshot associated with running servers. Update it only after a successful reload, so a failed rebind is retried on the next SIGHUP instead of reusing a stopped server. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Validate the newly read configuration before applying it. Invalid configuration now aborts reload before services are modified. Stop the node when configuration reload fails, preventing it from running with a runtime state that can differ from the configuration file or environment. Systemd restarts the node according to the service restart policy. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Return attribute parsing errors to the configuration reloader instead of terminating the process. Restore the previous node attributes when the updated attributes cannot be parsed. Signed-off-by: Andrey Butusov <andrey@nspcc.io>
Noticed some issues when adding a new configuration to gRPC.