fix(cmd/anubis): add signal handling to metrics server (#856)
This fixes a bug that was introduced in 68b653b0, in which the call
to metricsServer was passed a plain context.Background without
signal handling.
This commit adds back in the signal handling for the metrics server,
as well as for the Thoth client and storage backend.
Closes: #853
Signed-off-by: Emily Rowlands <emily@erowl.net>
This commit is contained in:
parent
59515ed669
commit
c59b7179c3
2 changed files with 6 additions and 5 deletions
|
|
@ -263,7 +263,10 @@ func main() {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
ctx := context.Background()
|
// install signal handler
|
||||||
|
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
||||||
|
defer stop()
|
||||||
|
|
||||||
wg := new(sync.WaitGroup)
|
wg := new(sync.WaitGroup)
|
||||||
|
|
||||||
if *metricsBind != "" {
|
if *metricsBind != "" {
|
||||||
|
|
@ -414,10 +417,6 @@ func main() {
|
||||||
log.Fatalf("can't construct libanubis.Server: %v", err)
|
log.Fatalf("can't construct libanubis.Server: %v", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
// install signal handler
|
|
||||||
ctx, stop := signal.NotifyContext(context.Background(), os.Interrupt, syscall.SIGTERM)
|
|
||||||
defer stop()
|
|
||||||
|
|
||||||
var h http.Handler
|
var h http.Handler
|
||||||
h = s
|
h = s
|
||||||
h = internal.RemoteXRealIP(*useRemoteAddress, *bindNetwork, h)
|
h = internal.RemoteXRealIP(*useRemoteAddress, *bindNetwork, h)
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
||||||
|
|
||||||
<!-- This changes the project to: -->
|
<!-- This changes the project to: -->
|
||||||
|
|
||||||
|
- Fix hanging on service restart ([#853](https://github.com/TecharoHQ/anubis/issues/853))
|
||||||
|
|
||||||
## v1.21.0: Minfilia Warde
|
## v1.21.0: Minfilia Warde
|
||||||
|
|
||||||
> Please, be at ease. You are among friends here.
|
> Please, be at ease. You are among friends here.
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue