Skip to content

Commit 9f199dd

Browse files
benjirewisjmatth
andauthored
RSDK-11248 RSDK-11266 RSDK-11900 RSDK-11901 Add restart checking logic (#153)
Co-authored-by: Joshua Matthews <[email protected]>
1 parent 0963fb4 commit 9f199dd

File tree

11 files changed

+553
-238
lines changed

11 files changed

+553
-238
lines changed

cmd/viam-agent/main.go

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,7 +213,8 @@ func setupExitSignalHandling() (context.Context, context.CancelFunc) {
213213
case syscall.SIGABRT:
214214
fallthrough
215215
case syscall.SIGTERM:
216-
globalLogger.Info("exiting")
216+
exitMsg := fmt.Sprintf("Signal received. %s will now exit to be restarted by service manager", agent.SubsystemName)
217+
globalLogger.Infow(exitMsg, "signal", sig)
217218
signal.Ignore(os.Interrupt, syscall.SIGTERM, syscall.SIGABRT) // keeping SIGQUIT for stack trace debugging
218219
return
219220

go.mod

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ require (
1010
github.com/jessevdk/go-flags v1.6.1
1111
github.com/nightlyone/lockfile v1.0.0
1212
github.com/pkg/errors v0.9.1
13+
github.com/samber/mo v1.16.0
1314
github.com/schollz/progressbar/v3 v3.18.0
1415
github.com/sergeymakinen/go-systemdconf/v2 v2.0.2
1516
github.com/tidwall/jsonc v0.3.2
@@ -29,7 +30,7 @@ require (
2930
require (
3031
github.com/cenkalti/backoff v2.2.1+incompatible // indirect
3132
github.com/cenkalti/backoff/v4 v4.3.0 // indirect
32-
github.com/davecgh/go-spew v1.1.1 // indirect
33+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc // indirect
3334
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 // indirect
3435
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
3536
github.com/dgottlieb/smarty-assertions v1.2.6 // indirect
@@ -72,15 +73,15 @@ require (
7273
github.com/pion/stun v0.6.1 // indirect
7374
github.com/pion/transport/v2 v2.2.10 // indirect
7475
github.com/pion/turn/v2 v2.1.6 // indirect
75-
github.com/pmezard/go-difflib v1.0.0 // indirect
76+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 // indirect
7677
github.com/rivo/uniseg v0.4.7 // indirect
7778
github.com/rs/cors v1.11.1 // indirect
7879
github.com/saltosystems/winrt-go v0.0.0-20240509164145-4f7860a3bd2b // indirect
7980
github.com/sirupsen/logrus v1.9.3 // indirect
8081
github.com/soypat/cyw43439 v0.0.0-20241116210509-ae1ce0e084c5 // indirect
8182
github.com/soypat/seqs v0.0.0-20240527012110-1201bab640ef // indirect
8283
github.com/srikrsna/protoc-gen-gotag v0.6.2 // indirect
83-
github.com/stretchr/testify v1.10.0 // indirect
84+
github.com/stretchr/testify v1.11.1 // indirect
8485
github.com/tinygo-org/cbgo v0.0.4 // indirect
8586
github.com/tinygo-org/pio v0.0.0-20231216154340-cd888eb58899 // indirect
8687
github.com/viamrobotics/webrtc/v3 v3.99.10 // indirect

go.sum

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -98,8 +98,9 @@ github.com/creack/pty v1.1.7/go.mod h1:lj5s0c3V2DBrqTV7llrYr5NG6My20zk30Fl46Y7Do
9898
github.com/creack/pty v1.1.9/go.mod h1:oKZEueFk5CKHvIhNR5MUki03XCEU+Q6VDXinZuGJ33E=
9999
github.com/daixiang0/gci v0.2.8/go.mod h1:+4dZ7TISfSmqfAGv59ePaHfNzgGtIkHAhhdKggP1JAc=
100100
github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
101-
github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c=
102101
github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
102+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc h1:U9qPSI2PIWSS1VwoXQT9A3Wy9MM3WgvqSxFWenqJduM=
103+
github.com/davecgh/go-spew v1.1.2-0.20180830191138-d8f796af33cc/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38=
103104
github.com/decred/dcrd/crypto/blake256 v1.0.1/go.mod h1:2OfgNZ5wDpcsFmHmCK5gZTPcCXqlm2ArzUIkw9czNJo=
104105
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0 h1:8UrgZ3GkP4i/CLijOJx79Yu+etlyjdBU4sfcs2WYQMs=
105106
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.2.0/go.mod h1:v57UDF4pDQJcEfFUCRop3lJL149eHGSe9Jvczhzjo/0=
@@ -539,8 +540,9 @@ github.com/pkg/errors v0.9.1 h1:FEBLx1zS214owpjy7qsBeixbURkuhQAwrK5UwLGTwt4=
539540
github.com/pkg/errors v0.9.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
540541
github.com/pkg/profile v1.2.1/go.mod h1:hJw3o1OdXxsrSjjVksARp5W95eeEaEfptyVZyv6JUPA=
541542
github.com/pkg/sftp v1.10.1/go.mod h1:lYOWFsE0bwd1+KfKJaKeuokY15vzFx25BLbzYYoAxZI=
542-
github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM=
543543
github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
544+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2 h1:Jamvg5psRIccs7FGNTlIRMkT8wgtp5eCXdBlqhYGL6U=
545+
github.com/pmezard/go-difflib v1.0.1-0.20181226105442-5d4384ee4fb2/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
544546
github.com/polyfloyd/go-errorlint v0.0.0-20201127212506-19bd8db6546f/go.mod h1:wi9BfjxjF/bwiZ701TzmfKu6UKC357IOAtNr0Td0Lvw=
545547
github.com/posener/complete v1.1.1/go.mod h1:em0nMJCgc9GFtwrmVmEMR/ZL6WyhyjMBndrE9hABlRI=
546548
github.com/prometheus/client_golang v0.9.1/go.mod h1:7SWBe2y4D6OKWSNQJUaRYU/AaXPKyh/dDVn+NZz0KFw=
@@ -593,6 +595,8 @@ github.com/ryanrolds/sqlclosecheck v0.3.0/go.mod h1:1gREqxyTGR3lVtpngyFo3hZAgk0K
593595
github.com/ryanuber/columnize v0.0.0-20160712163229-9b3edd62028f/go.mod h1:sm1tb6uqfes/u+d4ooFouqFdy9/2g9QGwK3SQygK0Ts=
594596
github.com/saltosystems/winrt-go v0.0.0-20240509164145-4f7860a3bd2b h1:du3zG5fd8snsFN6RBoLA7fpaYV9ZQIsyH9snlk2Zvik=
595597
github.com/saltosystems/winrt-go v0.0.0-20240509164145-4f7860a3bd2b/go.mod h1:CIltaIm7qaANUIvzr0Vmz71lmQMAIbGJ7cvgzX7FMfA=
598+
github.com/samber/mo v1.16.0 h1:qpEPCI63ou6wXlsNDMLE0IIN8A+devbGX/K1xdgr4b4=
599+
github.com/samber/mo v1.16.0/go.mod h1:DlgzJ4SYhOh41nP1L9kh9rDNERuf8IqWSAs+gj2Vxag=
596600
github.com/samuel/go-zookeeper v0.0.0-20190923202752-2cc03de413da/go.mod h1:gi+0XIa01GRL2eRQVjQkKGqKF3SF9vZR/HnPullcV2E=
597601
github.com/sanposhiho/wastedassign v0.1.3/go.mod h1:LGpq5Hsv74QaqM47WtIsRSF/ik9kqk07kchgv66tLVE=
598602
github.com/schollz/progressbar/v3 v3.18.0 h1:uXdoHABRFmNIjUfte/Ex7WtuyVslrw2wVPQmCN62HpA=
@@ -661,8 +665,8 @@ github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o
661665
github.com/stretchr/testify v1.8.3/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
662666
github.com/stretchr/testify v1.8.4/go.mod h1:sz/lmYIOXD/1dqDmKjjqLyZ2RngseejIcXlSw2iwfAo=
663667
github.com/stretchr/testify v1.9.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
664-
github.com/stretchr/testify v1.10.0 h1:Xv5erBjTwe/5IxqUQTdXv5kgmIvbHo3QQyRwhJsOfJA=
665-
github.com/stretchr/testify v1.10.0/go.mod h1:r2ic/lqez/lEtzL7wO/rwa5dbSLXVDPFyf8C91i36aY=
668+
github.com/stretchr/testify v1.11.1 h1:7s2iGBzp5EwR7/aIZr8ao5+dra3wiQyKjjFuvgVKu7U=
669+
github.com/stretchr/testify v1.11.1/go.mod h1:wZwfW3scLgRK+23gO65QZefKpKQRnfz6sD981Nm4B6U=
666670
github.com/subosito/gotenv v1.2.0/go.mod h1:N0PQaV/YGNqwC0u51sEeR/aUtSLEXKX9iv69rRypqCw=
667671
github.com/tdakkota/asciicheck v0.0.0-20200416200610-e657995f937b/go.mod h1:yHp0ai0Z9gUljN3o0xMhYJnH/IcvkdTBOX2fmJ93JEM=
668672
github.com/tetafro/godot v1.4.4/go.mod h1:FVDd4JuKliW3UgjswZfJfHq4vAx0bD/Jd5brJjGeaz4=

manager.go

Lines changed: 106 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import (
55
"context"
66
"encoding/json"
77
"errors"
8+
"fmt"
89
"net/url"
910
"os"
1011
"regexp"
@@ -21,13 +22,18 @@ import (
2122
"github.com/viamrobotics/agent/subsystems/viamserver"
2223
"github.com/viamrobotics/agent/utils"
2324
pb "go.viam.com/api/app/agent/v1"
25+
apppb "go.viam.com/api/app/v1"
2426
"go.viam.com/rdk/logging"
2527
goutils "go.viam.com/utils"
2628
"go.viam.com/utils/rpc"
2729
)
2830

2931
const (
30-
minimalCheckInterval = time.Second * 5
32+
// The minimal (and default) interval for checking for config updates via DeviceAgentConfig.
33+
minimalDeviceAgentConfigCheckInterval = time.Second * 5
34+
// The minimal (and default) interval for checking whether agent needs to be restarted.
35+
minimalNeedsRestartCheckInterval = time.Second * 1
36+
3137
defaultNetworkTimeout = time.Second * 15
3238
// stopAllTimeout must be lower than systemd subsystems/viamagent/viam-agent.service timeout of 4mins
3339
// and higher than subsystems/viamserver/viamserver.go timeout of 2mins.
@@ -42,7 +48,6 @@ type Manager struct {
4248

4349
connMu sync.RWMutex
4450
conn rpc.ClientConn
45-
client pb.AgentDeviceServiceClient
4651
cloudConfig *logging.CloudConfig
4752

4853
logger logging.Logger
@@ -209,7 +214,7 @@ func (m *Manager) SubsystemUpdates(ctx context.Context) {
209214
m.logger.Warn(err)
210215
}
211216
if m.viamAgentNeedsRestart {
212-
m.Exit()
217+
m.Exit(fmt.Sprintf("A new version of %s has been installed", SubsystemName))
213218
return
214219
}
215220
} else {
@@ -221,17 +226,19 @@ func (m *Manager) SubsystemUpdates(ctx context.Context) {
221226
needRestartConfigChange := m.viamServer.Update(ctx, m.cfg)
222227

223228
if needRestart || needRestartConfigChange || m.viamServerNeedsRestart || m.viamAgentNeedsRestart {
224-
if m.viamServer.(viamserver.RestartCheck).SafeToRestart(ctx) {
229+
if m.viamServer.Property(ctx, viamserver.RestartPropertyRestartAllowed) {
230+
m.logger.Infof("%s has allowed a restart; will restart", viamserver.SubsysName)
225231
if err := m.viamServer.Stop(ctx); err != nil {
226232
m.logger.Warn(err)
227233
} else {
228234
m.viamServerNeedsRestart = false
229235
}
230236
if m.viamAgentNeedsRestart {
231-
m.Exit()
237+
m.Exit(fmt.Sprintf("A new version of %s has been installed", SubsystemName))
232238
return
233239
}
234240
} else {
241+
m.logger.Warnf("%s has NOT allowed a restart; will NOT restart", viamserver.SubsysName)
235242
m.viamServerNeedsRestart = true
236243
}
237244
}
@@ -280,26 +287,26 @@ func (m *Manager) SubsystemUpdates(ctx context.Context) {
280287
// CheckUpdates retrieves an updated config from the cloud, and then passes it to SubsystemUpdates().
281288
func (m *Manager) CheckUpdates(ctx context.Context) time.Duration {
282289
defer utils.Recover(m.logger, nil)
283-
m.logger.Debug("Checking cloud for update")
284-
interval, err := m.GetConfig(ctx)
290+
m.logger.Debug("Checking cloud for device agent config updates")
291+
deviceAgentConfigCheckInterval, err := m.GetConfig(ctx)
285292

286-
if interval < minimalCheckInterval {
287-
interval = minimalCheckInterval
293+
if deviceAgentConfigCheckInterval < minimalDeviceAgentConfigCheckInterval {
294+
deviceAgentConfigCheckInterval = minimalDeviceAgentConfigCheckInterval
288295
}
289296

290297
// randomly fuzz the interval by +/- 5%
291-
interval = utils.FuzzTime(interval, 0.05)
298+
deviceAgentConfigCheckInterval = utils.FuzzTime(deviceAgentConfigCheckInterval, 0.05)
292299

293300
// we already log in all error cases inside GetConfig, so
294301
// no need to log again.
295302
if err != nil {
296-
return interval
303+
return deviceAgentConfigCheckInterval
297304
}
298305

299306
// update and (re)start subsystems
300307
m.SubsystemUpdates(ctx)
301308

302-
return interval
309+
return deviceAgentConfigCheckInterval
303310
}
304311

305312
func (m *Manager) setDebug(debug bool) {
@@ -380,13 +387,51 @@ func (m *Manager) SubsystemHealthChecks(ctx context.Context) {
380387
}
381388
}
382389

390+
// CheckIfNeedsRestart returns the check restart interval and whether the agent (and
391+
// therefore all its subsystems) has been forcibly restarted by app.
392+
func (m *Manager) CheckIfNeedsRestart(ctx context.Context) (time.Duration, bool) {
393+
m.logger.Debug("Checking cloud for forced restarts")
394+
if m.cloudConfig == nil {
395+
m.logger.Warn("can't CheckIfNeedsRestart until successful config load")
396+
return minimalNeedsRestartCheckInterval, false
397+
}
398+
399+
// Only continue this check if viam-server does not handle restart checking itself
400+
// (return early if viamserver _does_ handle restart checking).
401+
if !m.viamServer.Property(ctx, viamserver.RestartPropertyDoesNotHandleNeedsRestart) {
402+
return minimalNeedsRestartCheckInterval, false
403+
}
404+
405+
m.logger.Debug("Checking cloud for forced restarts")
406+
timeoutCtx, cancelFunc := context.WithTimeout(ctx, defaultNetworkTimeout)
407+
defer cancelFunc()
408+
409+
if err := m.dial(timeoutCtx); err != nil {
410+
m.logger.Warn(errw.Wrapf(err, "dialing to check if restart needed"))
411+
return minimalNeedsRestartCheckInterval, false
412+
}
413+
414+
robotServiceClient := apppb.NewRobotServiceClient(m.conn)
415+
req := &apppb.NeedsRestartRequest{Id: m.cloudConfig.ID}
416+
res, err := robotServiceClient.NeedsRestart(timeoutCtx, req)
417+
if err != nil {
418+
m.logger.Warn(errw.Wrapf(err, "checking if restart needed"))
419+
return minimalNeedsRestartCheckInterval, false
420+
}
421+
422+
return res.GetRestartCheckInterval().AsDuration(), res.GetMustRestart()
423+
}
424+
383425
// CloseAll stops all subsystems and closes the cloud connection.
384426
func (m *Manager) CloseAll() {
385427
ctx, cancel := context.WithCancel(context.Background())
386428

387429
// Use a slow goroutine watcher to log and continue if shutdown is taking too long.
388430
slowWatcher, slowWatcherCancel := goutils.SlowGoroutineWatcher(
389-
stopAllTimeout, "Agent is taking a while to shut down,", m.logger)
431+
stopAllTimeout,
432+
fmt.Sprintf("Viam agent subsystems and/or background workers failed to shut down within %v", stopAllTimeout),
433+
m.logger,
434+
)
390435

391436
slowTicker := time.NewTicker(10 * time.Second)
392437
defer slowTicker.Stop()
@@ -430,7 +475,6 @@ func (m *Manager) CloseAll() {
430475
}
431476
}
432477

433-
m.client = nil
434478
m.conn = nil
435479
})
436480

@@ -479,7 +523,8 @@ func (m *Manager) CloseAll() {
479523
}
480524
}
481525

482-
// StartBackgroundChecks kicks off a go routine that loops on a timer to check for updates and health checks.
526+
// StartBackgroundChecks kicks off go routines that loop on a timerr to check for updates,
527+
// health checks, and restarts.
483528
func (m *Manager) StartBackgroundChecks(ctx context.Context) {
484529
if ctx.Err() != nil {
485530
return
@@ -495,18 +540,18 @@ func (m *Manager) StartBackgroundChecks(ctx context.Context) {
495540
})
496541
defer m.activeBackgroundWorkers.Done()
497542

498-
checkInterval := minimalCheckInterval
543+
deviceAgentConfigCheckInterval := minimalDeviceAgentConfigCheckInterval
499544
m.cfgMu.RLock()
500545
wait := m.cfg.AdvancedSettings.WaitForUpdateCheck.Get()
501546
m.cfgMu.RUnlock()
502547
if wait {
503-
checkInterval = m.CheckUpdates(ctx)
548+
deviceAgentConfigCheckInterval = m.CheckUpdates(ctx)
504549
} else {
505550
// premptively start things before we go into the regular update/check/restart
506551
m.SubsystemHealthChecks(ctx)
507552
}
508553

509-
timer := time.NewTimer(checkInterval)
554+
timer := time.NewTimer(deviceAgentConfigCheckInterval)
510555
defer timer.Stop()
511556
for {
512557
if ctx.Err() != nil {
@@ -516,9 +561,39 @@ func (m *Manager) StartBackgroundChecks(ctx context.Context) {
516561
case <-ctx.Done():
517562
return
518563
case <-timer.C:
519-
checkInterval = m.CheckUpdates(ctx)
564+
deviceAgentConfigCheckInterval = m.CheckUpdates(ctx)
520565
m.SubsystemHealthChecks(ctx)
521-
timer.Reset(checkInterval)
566+
timer.Reset(deviceAgentConfigCheckInterval)
567+
}
568+
}
569+
}()
570+
571+
m.activeBackgroundWorkers.Add(1)
572+
go func() {
573+
defer m.activeBackgroundWorkers.Done()
574+
575+
timer := time.NewTimer(minimalNeedsRestartCheckInterval)
576+
defer timer.Stop()
577+
for {
578+
if ctx.Err() != nil {
579+
return
580+
}
581+
select {
582+
case <-ctx.Done():
583+
return
584+
case <-timer.C:
585+
needsRestartCheckInterval, needsRestart := m.CheckIfNeedsRestart(ctx)
586+
if needsRestartCheckInterval < minimalNeedsRestartCheckInterval {
587+
needsRestartCheckInterval = minimalNeedsRestartCheckInterval
588+
}
589+
if needsRestart {
590+
// Do not mark m.agentNeedsRestart and instead Exit immediately; we do not want
591+
// to wait for viam-server to allow a restart as it may be in a bad state.
592+
m.Exit(fmt.Sprintf("A restart of %s was requested from app", SubsystemName))
593+
}
594+
// As with the device agent config check interval, randomly fuzz the interval by
595+
// +/- 5%.
596+
timer.Reset(utils.FuzzTime(needsRestartCheckInterval, 0.05))
522597
}
523598
}
524599
}()
@@ -531,11 +606,11 @@ func (m *Manager) dial(ctx context.Context) error {
531606
return ctx.Err()
532607
}
533608
if m.cloudConfig == nil {
534-
return errors.New("cannot dial() until successful LoadConfig")
609+
return errors.New("cannot dial() until successful config load")
535610
}
536611
m.connMu.Lock()
537612
defer m.connMu.Unlock()
538-
if m.client != nil {
613+
if m.conn != nil {
539614
return nil
540615
}
541616

@@ -564,7 +639,6 @@ func (m *Manager) dial(ctx context.Context) error {
564639
return err
565640
}
566641
m.conn = conn
567-
m.client = pb.NewAgentDeviceServiceClient(m.conn)
568642

569643
if m.netAppender != nil {
570644
m.netAppender.SetConn(conn, true)
@@ -577,27 +651,28 @@ func (m *Manager) dial(ctx context.Context) error {
577651
// GetConfig retrieves the configuration from the cloud.
578652
func (m *Manager) GetConfig(ctx context.Context) (time.Duration, error) {
579653
if m.cloudConfig == nil {
580-
err := errors.New("can't GetConfig until successful LoadConfig")
654+
err := errors.New("can't GetConfig until successful config load")
581655
m.logger.Warn(err)
582-
return minimalCheckInterval, err
656+
return minimalDeviceAgentConfigCheckInterval, err
583657
}
584658
timeoutCtx, cancelFunc := context.WithTimeout(ctx, defaultNetworkTimeout)
585659
defer cancelFunc()
586660

587661
if err := m.dial(timeoutCtx); err != nil {
588-
m.logger.Warn(errw.Wrapf(err, "fetching %s config", SubsystemName))
589-
return minimalCheckInterval, err
662+
m.logger.Warn(errw.Wrapf(err, "dialing to fetch %s config", SubsystemName))
663+
return minimalDeviceAgentConfigCheckInterval, err
590664
}
591665

666+
agentDeviceServiceClient := pb.NewAgentDeviceServiceClient(m.conn)
592667
req := &pb.DeviceAgentConfigRequest{
593668
Id: m.cloudConfig.ID,
594669
HostInfo: m.getHostInfo(),
595670
VersionInfo: m.getVersions(),
596671
}
597-
resp, err := m.client.DeviceAgentConfig(timeoutCtx, req)
672+
resp, err := agentDeviceServiceClient.DeviceAgentConfig(timeoutCtx, req)
598673
if err != nil {
599674
m.logger.Warn(errw.Wrapf(err, "fetching %s config", SubsystemName))
600-
return minimalCheckInterval, err
675+
return minimalDeviceAgentConfigCheckInterval, err
601676
}
602677
fixWindowsPaths(resp)
603678

@@ -699,7 +774,7 @@ func (m *Manager) getVersions() *pb.VersionInfo {
699774
return vers
700775
}
701776

702-
func (m *Manager) Exit() {
703-
m.logger.Info("A new viam-agent has been installed. Will now exit to be restarted by service manager.")
777+
func (m *Manager) Exit(reason string) {
778+
m.logger.Infow(fmt.Sprintf("%s will now exit to be restarted by service manager", SubsystemName), "reason", reason)
704779
m.globalCancel()
705780
}

subsystems/networking/networking_linux.go

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -461,3 +461,8 @@ func (n *Networking) writeWifiPowerSave(ctx context.Context) error {
461461

462462
return nil
463463
}
464+
465+
// Property is a noop for the networking subsystem.
466+
func (n *Networking) Property(_ context.Context, _ string) bool {
467+
return false
468+
}

0 commit comments

Comments
 (0)