Skip to content

Commit

Permalink
feat: print the status of services during boot
Browse files Browse the repository at this point in the history
If the a service hangs in the boot sequence will not finish. To inform
users we poll the collection of services in the StartAllServices task
regularly and log if their status has changed.

Fixes #5449

Signed-off-by: Andrey Smirnov <[email protected]>
Signed-off-by: Philipp Sauter <[email protected]>
  • Loading branch information
smira authored and Philipp Sauter committed May 11, 2022
1 parent 802d4a2 commit 2b7e7d4
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 3 deletions.
2 changes: 1 addition & 1 deletion ADOPTERS.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ A list of adopters of Talos Linux, and the use
* **[Nedap Security Atlas](https://nedapsecurityatlas.com)**
Nedap Security Atlas does all on-premise development, unit and integration testing in Gitlab running on Talos clusters.

* **[Sidero Labs](https://www.siderolanbs.com)**
* **[Sidero Labs](https://www.siderolabs.com)**
Sidero Labs uses Talos to build & test Talos! All the unit and end-to-end testing happens on our CI platform running in Talos-backed Kubernetes clusters.

## Contributing
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -708,7 +708,26 @@ func StartAllServices(seq runtime.Sequence, data interface{}) (runtime.TaskExecu
ctx, cancel := context.WithTimeout(ctx, constants.BootTimeout)
defer cancel()

return conditions.WaitForAll(all...).Wait(ctx)
aggregateCondition := conditions.WaitForAll(all...)

errChan := make(chan error)

go func() {
errChan <- aggregateCondition.Wait(ctx)
}()

ticker := time.NewTicker(15 * time.Second)
defer ticker.Stop()

for {
logger.Printf("%s", aggregateCondition.String())

select {
case err := <-errChan:
return err
case <-ticker.C:
}
}
}, "startAllServices"
}

Expand Down
2 changes: 1 addition & 1 deletion website/content/v1.1/advanced/developing-talos.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ sudo -E _out/talosctl-linux-amd64 cluster create \
--registry-mirror gcr.io=http://172.20.0.1:5003 \
--registry-mirror ghcr.io=http://172.20.0.1:5004 \
--registry-mirror 127.0.0.1:5005=http://172.20.0.1:5005 \
--install-image=127.0.0.1:5005/talos-systems/installer:<RECORDED HASH from the build step> \
--install-image=127.0.0.1:5005/siderolabs/installer:<RECORDED HASH from the build step> \
--masters 3 \
--workers 2 \
--with-bootloader=false
Expand Down

0 comments on commit 2b7e7d4

Please sign in to comment.