Skip to content

Commit 8afdd5e

Browse files
authored
Clearer reconfig abort message (viamrobotics#5660)
1 parent 0efd011 commit 8afdd5e

File tree

1 file changed

+16
-4
lines changed

1 file changed

+16
-4
lines changed

robot/impl/local_robot.go

Lines changed: 16 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1461,8 +1461,12 @@ func (r *localRobot) reconfigure(ctx context.Context, newConfig *config.Config,
14611461
// The returned error is rich, detailing each individual packages error. The underlying
14621462
// `Sync` call is responsible for logging those errors in a readable way. We only need to
14631463
// log that reconfiguration is exited. To minimize the distraction of reading a list of
1464-
// verbose errors that was arleady logged.
1465-
r.Logger().CErrorw(ctx, "reconfiguration aborted because cloud modules or packages download failed")
1464+
// verbose errors that was already logged.
1465+
r.Logger().CErrorw(
1466+
ctx,
1467+
"reconfiguration aborted because cloud modules or packages download and/or unzip failed, "+
1468+
"currently running modules will not be shutdown",
1469+
)
14661470
return
14671471
}
14681472
// For local tarball modules, we create synthetic versions for package management. The `localRobot` keeps track of these because
@@ -1475,15 +1479,23 @@ func (r *localRobot) reconfigure(ctx context.Context, newConfig *config.Config,
14751479
// Same as the above `Sync` call error handling. The returned error is rich, detailing each
14761480
// individual packages error. The underlying `Sync` call is responsible for logging those
14771481
// errors in a readable way.
1478-
r.Logger().CErrorw(ctx, "reconfiguration aborted because local modules or packages sync failed")
1482+
r.Logger().CErrorw(
1483+
ctx,
1484+
"reconfiguration aborted because local modules or packages sync failed, currently running modules will not be shutdown",
1485+
)
14791486
return
14801487
}
14811488

14821489
// Run the setup phase for new and modified modules in new config modules before proceeding with reconfiguration.
14831490
mods := slices.Concat[[]config.Module](initialDiff.Added.Modules, initialDiff.Modified.Modules)
14841491
for _, mod := range mods {
14851492
if err := r.manager.moduleManager.FirstRun(ctx, mod); err != nil {
1486-
r.logger.CErrorw(ctx, "error executing first run", "module", mod.Name, "error", err)
1493+
r.logger.CErrorw(
1494+
ctx,
1495+
"reconfiguration aborted because of error executing first run, currently running modules will not be shutdown",
1496+
"module", mod.Name,
1497+
"error", err,
1498+
)
14871499
return
14881500
}
14891501
}

0 commit comments

Comments
 (0)