Skip to content

Commit

Permalink
Decrease time needed to boot pillar microservices
Browse files Browse the repository at this point in the history
device-steps.sh waits for zedbox to create touch file.
However, the first iteration of zedbox updating touch file
starts only after 15 seconds of pointless sleep.

Signed-off-by: Milan Lenco <[email protected]>
  • Loading branch information
milan-zededa authored and eriknordmark committed Nov 16, 2023
1 parent 8a4db84 commit 0ea504e
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 1 deletion.
1 change: 1 addition & 0 deletions pkg/pillar/cmd/loguploader/loguploader.go
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ func Run(ps *pubsub.PubSub, loggerArg *logrus.Logger, logArg *base.LogObject, ar

// Run a periodic timer so we always update StillRunning
stillRunning := time.NewTicker(stillRunningInerval)
ps.StillRunning(agentName, warningTime, errorTime)

// Wait until we have been onboarded aka know our own UUID
subOnboardStatus, err := ps.NewSubscription(pubsub.SubscriptionOptions{
Expand Down
3 changes: 2 additions & 1 deletion pkg/pillar/cmd/nodeagent/nodeagent.go
Original file line number Diff line number Diff line change
Expand Up @@ -123,7 +123,7 @@ type nodeagentContext struct {
domainHaltWaitIncrement uint32
}

func newNodeagentContext(_ *pubsub.PubSub, _ *logrus.Logger, _ *base.LogObject) *nodeagentContext {
func newNodeagentContext(ps *pubsub.PubSub, _ *logrus.Logger, _ *base.LogObject) *nodeagentContext {
nodeagentCtx := nodeagentContext{}
nodeagentCtx.minRebootDelay = minRebootDelay
nodeagentCtx.maxDomainHaltTime = maxDomainHaltTime
Expand All @@ -134,6 +134,7 @@ func newNodeagentContext(_ *pubsub.PubSub, _ *logrus.Logger, _ *base.LogObject)
// start the watchdog process timer tick
duration := time.Duration(watchdogInterval) * time.Second
nodeagentCtx.stillRunning = time.NewTicker(duration)
ps.StillRunning(agentName, warningTime, errorTime)

// set the ticker timer
duration = time.Duration(timeTickInterval) * time.Second
Expand Down
1 change: 1 addition & 0 deletions pkg/pillar/cmd/zfsmanager/zfsmanager.go
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ func Run(ps *pubsub.PubSub, loggerArg *logrus.Logger, logArg *base.LogObject, ar

// Run a periodic timer so we always update StillRunning
stillRunning := time.NewTicker(stillRunningInterval)
ps.StillRunning(agentName, warningTime, errorTime)

// Wait until we have been onboarded aka know our own UUID, but we don't use the UUID
err := utils.WaitForOnboarded(ps, log, agentName, warningTime, errorTime)
Expand Down
1 change: 1 addition & 0 deletions pkg/pillar/zedbox/zedbox.go
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,7 @@ func runZedbox(ps *pubsub.PubSub, logger *logrus.Logger, log *base.LogObject, ar
agentbase.WithArguments(arguments))

stillRunning := time.NewTicker(15 * time.Second)
ps.StillRunning(agentName, warningTime, errorTime)

subChan := reverse.NewSubscriber(log, agentName,
types.ServiceInitStatus{})
Expand Down

0 comments on commit 0ea504e

Please sign in to comment.