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

feat: add StateStarterUp to move expensive init ops to dedicated methods #330

Merged

Conversation

dmitry-lyfar
Copy link
Contributor

This PR introduces the StateStarterUp interface alongside its implementations for Overlord and StateEngine.

These changes were ported and adopted for pebble from the original snapd PR: canonical/snapd#7132

See also: #327

Introduce the StateStarterUp interface alongside its implementations for
Overlord and StateEngine.

These changes were cherry-picked and adopted for pebble from the
original snapd PR: canonical/snapd#7132
@dmitry-lyfar
Copy link
Contributor Author

@benhoyt @anpep based on our previous discussion in #327, I started the state package updates merge from the StateStarterUp interface as it seems is required by others already.

The other changes as per the plan discussed here will follow in separate PRs.

Previously, the daemon start logic did not return anything; With the
StateStarterUp introduced one needs to verify there were no issues at
Start to continue the daemon initialisation
Copy link
Contributor

@benhoyt benhoyt left a comment

Choose a reason for hiding this comment

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

I've compared to the snapd PR in question, and this looks good to me. Thanks! @anpep can you also please review just for a second eye, and then we'll merge?

@benhoyt benhoyt changed the title Add StateStarterUp to move expensive init ops to dedicated methods feat: add StateStarterUp to move expensive init ops to dedicated methods Nov 19, 2023
@anpep anpep self-requested a review November 20, 2023 07:41
Copy link
Collaborator

@anpep anpep left a comment

Choose a reason for hiding this comment

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

Looks great, thank you! There were a lot of overlooks in my PR, but this one surely gets things right (:

internals/overlord/stateengine.go Show resolved Hide resolved
@benhoyt benhoyt merged commit 4468986 into canonical:master Nov 22, 2023
11 of 16 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
Development

Successfully merging this pull request may close these issues.

3 participants