mirror of
https://github.com/prometheus/prometheus.git
synced 2025-01-14 07:17:52 -08:00
Fixup sighup for P2 TSDB init #2699
This commit is contained in:
parent
ff0ee264ae
commit
4177c35eba
|
@ -78,6 +78,11 @@ func Main() int {
|
||||||
reloadables []Reloadable
|
reloadables []Reloadable
|
||||||
)
|
)
|
||||||
|
|
||||||
|
// Make sure that sighup handler is registered with a redirect to the channel before the potentially
|
||||||
|
// long and synchronous tsdb init.
|
||||||
|
hup := make(chan os.Signal)
|
||||||
|
hupReady := make(chan bool)
|
||||||
|
signal.Notify(hup, syscall.SIGHUP)
|
||||||
localStorage, err := tsdb.Open(cfg.localStoragePath, prometheus.DefaultRegisterer, &cfg.tsdb)
|
localStorage, err := tsdb.Open(cfg.localStoragePath, prometheus.DefaultRegisterer, &cfg.tsdb)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("Opening storage failed: %s", err)
|
log.Errorf("Opening storage failed: %s", err)
|
||||||
|
@ -136,9 +141,6 @@ func Main() int {
|
||||||
// Wait for reload or termination signals. Start the handler for SIGHUP as
|
// Wait for reload or termination signals. Start the handler for SIGHUP as
|
||||||
// early as possible, but ignore it until we are ready to handle reloading
|
// early as possible, but ignore it until we are ready to handle reloading
|
||||||
// our config.
|
// our config.
|
||||||
hup := make(chan os.Signal)
|
|
||||||
hupReady := make(chan bool)
|
|
||||||
signal.Notify(hup, syscall.SIGHUP)
|
|
||||||
go func() {
|
go func() {
|
||||||
<-hupReady
|
<-hupReady
|
||||||
for {
|
for {
|
||||||
|
|
Loading…
Reference in a new issue