Repository navigation
Conversation
0f243c6 to
89c4562
Compare
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Failure-recovery errors can emit a restart event even though the transient recovery process is not restarted.
Review effort: Balanced
Findings: 1
What changed in this PR
Adds security events for unexpected snapd restarts and no-op failure recovery.
Changes:
- Adds restart reasons and optional error descriptions.
- Logs restart events before security logging teardown.
- Extends unit coverage for new restart paths.
| File | Description |
|---|---|
seclog/seclog.go |
Supports error-aware restart descriptions. |
seclog/seclog_test.go |
Tests restart event formatting. |
overlord/restart/restart.go |
Defines new restart reasons. |
daemon/daemon.go |
Logs no-op failure recovery restarts. |
daemon/daemon_test.go |
Tests failure recovery logging. |
cmd/snapd/daemon/main.go |
Logs unexpected run errors. |
cmd/snapd/daemon/main_test.go |
Tests unexpected restart filtering. |
cmd/snapd/daemon/export_test.go |
Exposes the helper for tests. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #17763 +/- ##
==========================================
- Coverage 82.06% 78.50% -3.57%
==========================================
Files 1420 1416 -4
Lines 201401 201315 -86
Branches 2503 2503
==========================================
- Hits 165279 158039 -7240
+ Misses 33914 33863 -51
- Partials 2208 9413 +7205
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
89c4562 to
d278633
Compare
|
Tue Oct 13 19:21:05 UTC 2026 Test Predictor AnalysisPreparing
Executing
Skipped tests from snapd-testing-skipIf you wish to have any of the below tests run in your PR, in your PR description, add 'unskip:' followed by a copy-and-pasted list of the below tests you wish to run (unskip plus test list must be valid yaml)
|
ad5bc34 to
c396d5b
Compare
c396d5b to
70ce378
Compare
70ce378 to
11ec780
Compare
602874e to
17a6da6
Compare
c57d073 to
971dcc6
Compare
a94949f to
5689b6a
Compare
5689b6a to
241c063
Compare
Record stop failures and an aborted idle standby as sys_restart_snapd reasons.
241c063 to
a90446e
Compare
|
Failure analysis: Not related to changes. |


Log snapd process exits that previously had no lifecycle event.
sys_restart_snapdstays reason-only: attributes aresnapd_versionandreason. There is no error attribute and no error text in the description. The Go error remains in the journal from the process exit.Rebased on master, which includes the signal event from #17762. A
SIGTERMorSIGINTstop issys_exit_signal_snapd. This change logssys_restart_snapdfor the stop-failed and idle-aborted cases below.Summary:
snapd-idle-aborted. The process exits 0.Stopreturns an error (no Overlord, ortomb.Waitfails outside a system shutdown), log reasonsnapd-stop-failed.seclog. They are notrestart.RestartReasonvalues and are not passed torestart.Request.RestartSnapdIdlestays aRestartSocketrequest. Completed socket standby (ErrRestartSocket, exit 42) still logssys_standby_snapdwith reasonsnapd-idle.snapd-update,snapd-revert,snapd-undo,snapd-feature-change) are unchanged.LogSystemRestartSnapdandLogSystemStandbySnapdtake the reason as a string.sys_exit_signal_snapdonly.StopDaemon(preseed), system restart and shutdown (doReboot, including a signal that arrives while waiting), and both snap-failure startup results stay offsys_restart_snapd. Those starts are alreadysys_startup_snapd.SNAPD_STANDBY_WAIT=1sdoes not remain in an already running process. It still checkssys_exit_signal_snapd,snapd-update, andsnapd-idle.Spec: SD236- Security Event Logging
JIRA: https://warthogs.atlassian.net/browse/SNAPDENG-37102