16552: boot: wait for child proc cleanup when shutting down.
authorTom Clegg <tom@curii.com>
Thu, 30 Jun 2022 03:59:37 +0000 (23:59 -0400)
committerTom Clegg <tom@curii.com>
Thu, 30 Jun 2022 03:59:37 +0000 (23:59 -0400)
Arvados-DCO-1.1-Signed-off-by: Tom Clegg <tom@curii.com>

lib/boot/supervisor.go

index 8eb375b874853821944cef1c87bbd650bd6547ee..52cd0b16167a9d9f31767cb9ec4975c1eee1e8fc 100644 (file)
@@ -471,6 +471,7 @@ func (super *Supervisor) WaitReady() bool {
                        super.logger.Infof("waiting for %s to be ready", id)
                        if !super2.WaitReady() {
                                super.logger.Infof("%s startup failed", id)
+                               super.Stop()
                                return false
                        }
                        super.logger.Infof("%s is ready", id)
@@ -484,6 +485,7 @@ func (super *Supervisor) WaitReady() bool {
                select {
                case <-ticker.C:
                case <-super.ctx.Done():
+                       super.Stop()
                        return false
                }
                if super.healthChecker == nil {