Skip to content

Commit 236fc46

Browse files
thaJeztahcorhere
authored andcommitted
daemon/command: don't make notifyReady(), notifyStopping() asynchronous
Leave it to the consumer to decide whether these should be called in a goroutine. Signed-off-by: Sebastiaan van Stijn <[email protected]>
1 parent 3f04413 commit 236fc46

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

daemon/command/daemon.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -336,7 +336,7 @@ func (cli *daemonCLI) start(ctx context.Context) (err error) {
336336
cli.setupConfigReloadTrap()
337337

338338
// after the daemon is done setting up we can notify systemd api
339-
notifyReady()
339+
go notifyReady()
340340
log.G(ctx).Info("Daemon has completed initialization")
341341

342342
// Daemon is fully initialized. Start handling API traffic
@@ -369,7 +369,7 @@ func (cli *daemonCLI) start(ctx context.Context) (err error) {
369369
c.Cleanup()
370370

371371
// notify systemd that we're shutting down
372-
notifyStopping()
372+
go notifyStopping()
373373
shutdownDaemon(ctx, d)
374374

375375
// shutdown / close BuildKit backend

daemon/command/daemon_linux.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ func preNotifyReady() error {
5050
// notifyReady sends a message to the host when the server is ready to be used
5151
func notifyReady() {
5252
// Tell the init daemon we are accepting requests
53-
go systemdDaemon.SdNotify(false, systemdDaemon.SdNotifyReady)
53+
_, _ = systemdDaemon.SdNotify(false, systemdDaemon.SdNotifyReady)
5454
}
5555

5656
// notifyStopping sends a message to the host when the server is shutting down
5757
func notifyStopping() {
58-
go systemdDaemon.SdNotify(false, systemdDaemon.SdNotifyStopping)
58+
_, _ = systemdDaemon.SdNotify(false, systemdDaemon.SdNotifyStopping)
5959
}
6060

6161
func validateCPURealtimeOptions(cfg *config.Config) error {

0 commit comments

Comments
 (0)