mirror of
https://github.com/grafana/grafana.git
synced 2025-02-25 18:55:37 -06:00
Fail when server is unable to bind port (#20409)
* Server: Return error when unable to bind port * Server: Exit if a service fails * Build: Remove graceful kill from Bra config
This commit is contained in:
@@ -103,7 +103,7 @@ func (s *Server) Run() (err error) {
|
||||
s.log.Info("Initializing " + service.Name)
|
||||
|
||||
if err := service.Instance.Init(); err != nil {
|
||||
return fmt.Errorf("Service init failed: %v", err)
|
||||
return errutil.Wrapf(err, "Service init failed")
|
||||
}
|
||||
}
|
||||
|
||||
@@ -126,18 +126,21 @@ func (s *Server) Run() (err error) {
|
||||
return nil
|
||||
}
|
||||
|
||||
if err := service.Run(s.context); err != nil {
|
||||
err := service.Run(s.context)
|
||||
// Mark that we are in shutdown mode
|
||||
// So no more services are started
|
||||
s.shutdownInProgress = true
|
||||
if err != nil {
|
||||
if err != context.Canceled {
|
||||
// Server has crashed.
|
||||
s.log.Error("Stopped "+descriptor.Name, "reason", err)
|
||||
} else {
|
||||
s.log.Info("Stopped "+descriptor.Name, "reason", err)
|
||||
}
|
||||
|
||||
return err
|
||||
}
|
||||
|
||||
// Mark that we are in shutdown mode
|
||||
// So more services are not started
|
||||
s.shutdownInProgress = true
|
||||
return nil
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user