Graceful shutdown if metrics/pprof/control service is not available #2651
Labels
enhancement
Improving existing functionality
I3
Minimal impact
neofs-ir
Inner Ring node application issues
neofs-storage
Storage node application issues
S4
Routine
U3
Regular
Is your feature request related to a problem? Please describe.
If some bad happens in
http.Serve
we just die instantly: here, here and here. These services are kinda the most important for us (they allows us understanding if the other services work in general and making decisions based on statistic information) but not that important to kill application on any error likeos.Exit(1)
.Describe the solution you'd like
Find out a better way to handle these errors e.g. canceling app context and waiting for other services to shutdown.
Describe alternatives you've considered
Do nothing, it works almost all the time ok.
Additional context
After #2585, #2428 and similar things, canceling context may become not the best way to do it: metrics will be the first thing to run and if they die, other services may not be inited yet (and initialization sometimes take its time and no
Init
takescontext.Context
), so no shutdown will be performed until all theInit
is done.The text was updated successfully, but these errors were encountered: