15954: Don't start health checks until everything is started.
authorTom Clegg <tom@tomclegg.ca>
Wed, 19 Feb 2020 15:24:18 +0000 (10:24 -0500)
committerTom Clegg <tom@tomclegg.ca>
Thu, 20 Feb 2020 19:25:03 +0000 (14:25 -0500)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@tomclegg.ca>

lib/boot/cmd.go

index 105c94e9ff32168818b7714e3fdba499c15a9425..834d99ca5c3d9fd6af128ac7c78c5e8c5f605440 100644 (file)
@@ -212,7 +212,6 @@ func (boot *Booter) run(cfg *arvados.Config) error {
        boot.logger = ctxlog.New(boot.Stderr, boot.cluster.SystemLogs.Format, loglevel).WithFields(logrus.Fields{
                "PID": os.Getpid(),
        })
-       boot.healthChecker = &health.Aggregator{Cluster: boot.cluster}
 
        for _, dir := range []string{boot.LibPath, filepath.Join(boot.LibPath, "bin")} {
                if _, err = os.Stat(filepath.Join(dir, ".")); os.IsNotExist(err) {
@@ -283,7 +282,10 @@ func (boot *Booter) run(cfg *arvados.Config) error {
        if err != nil {
                return err
        }
+       boot.logger.Info("all startup tasks are complete; starting health checks")
+       boot.healthChecker = &health.Aggregator{Cluster: boot.cluster}
        <-boot.ctx.Done()
+       boot.logger.Info("shutting down")
        return boot.ctx.Err()
 }