Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

o/snapstate: in hybrid systems re-refresh before reboot if possible #13955

Merged
merged 2 commits into from
May 28, 2024

Conversation

MiguelPires
Copy link
Contributor

In hybrid systems where we do refreshes of apps before the reboot and essential snaps after, check if a re-refresh is necessary after the apps are done instead of waiting for all (and therefore a reboot). This is possible because currently essential snaps don't use epochs and don't require re-refreshes. If an app has a dependency that requires a reboot (like the model base), then the check-rerefresh task needs to wait for that refresh to complete. Since, if we're waiting for the reboot, there isn't much to gain in resolving the app's dependencies to only wait for those, the check-rerefresh preserves the old behavior in that case to keep things simple.

In hybrid systems where we do refreshes of apps before the reboot and
essential snaps after, check if a re-refresh is necessary after the apps
are done instead of waiting for all (and therefore a reboot). This is
possible because currently essential snaps don't use epochs and don't
require re-refreshes. If an app has a dependency that requires a reboot
(like the model base), then the check-rerefresh task needs to wait for
that refresh to complete. Since, if we're waiting for the reboot, there
isn't much to gain in resolving the app's dependencies to only wait
for those, the check-rerefresh preserves the old behavior in that case
to keep things simple.

Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
@MiguelPires MiguelPires changed the title o/snapstate: rerefresh before reboot if possible o/snapstate: in hybrid systems rerefresh before reboot if possible May 8, 2024
Copy link
Collaborator

@andrewphelpsj andrewphelpsj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good, one question to consider.

overlord/snapstate/snapstate.go Outdated Show resolved Hide resolved
Copy link
Collaborator

@andrewphelpsj andrewphelpsj left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks! LGTM

Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you, some comments

overlord/snapstate/handlers.go Show resolved Hide resolved
overlord/snapstate/snapstate.go Outdated Show resolved Hide resolved
overlord/restart/restart.go Outdated Show resolved Hide resolved
Signed-off-by: Miguel Pires <miguel.pires@canonical.com>
@MiguelPires MiguelPires requested a review from pedronis May 28, 2024 10:43
Copy link
Collaborator

@pedronis pedronis left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thank you

@ernestl ernestl changed the title o/snapstate: in hybrid systems rerefresh before reboot if possible o/snapstate: in hybrid systems re-refresh before reboot if possible May 28, 2024
@ernestl ernestl merged commit 301beef into snapcore:master May 28, 2024
42 of 49 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
4 participants