Remove more os.Exit calls and give a more reliable wait for stop function (attempt 3) (#1661)

This commit is contained in:
Jack Doan authored and GitHub committed 2026-04-20 16:08:26 -05:00
1 parent 49e3c4649b
commit e80b9830a3
15 files changed
+552 -94

No files matched your search

+14 -2
View File
@@ -72,9 +72,21 @@ func main() {
}
if !*configTest {
ctrl.Start()
wait, err := ctrl.Start()
if err != nil {
util.LogWithContextIfNeeded("Error while running", err, l)
os.Exit(1)
}
go ctrl.ShutdownBlock()
notifyReady(l)
ctrl.ShutdownBlock()
if err := wait(); err != nil {
l.WithError(err).Error("Nebula stopped due to fatal error")
os.Exit(2)
}
l.Info("Goodbye")
}
os.Exit(0)