Skip to content

State engine Ensure() errors are only logged, not handled #445

Open
@thp-canonical

Description

Right now in Overlord.Loop(), the error return of the state engine's Ensure() function are ignored:

// in case of errors engine logs them,
// continue to the next Ensure() try for now
o.stateEng.Ensure()

Meanwhile, snapd handles errors - at least in the pressed case - in Ensure():

https://github.com/snapcore/snapd/blob/c59a5f6e87fe59596b14614bc422e0c3a132ca25/overlord/overlord.go#L463-L473

This has been implemented in snapd for preseeding: canonical/snapd#8190

As other components of Pebble might have the same issue (retrying Ensure() forever not resulting in a change), and implementers of managers might believe that an error returned from Ensure() will be handled by the caller, it might make sense to at least allow an optional error handler to handle Ensure() errors in the overlord loop.

Found with @flotter during code review.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    25.04Planned for the 25.04 cycleSimpleNice for a quick look on a minute or two

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions