Skip to main content

commit_with_lifecycle

Function commit_with_lifecycle 

Source
pub fn commit_with_lifecycle<M: ServiceManager, C: PostInstallCheck>(
    manager: &mut M,
    spec: &ServiceSpec,
    transaction: ValidatedTransaction,
    ownership: CommitOwnership<'_>,
    policy: LifecycleUpdatePolicy,
    check: &C,
) -> Result<LifecycleUpdateReceipt, LifecycleUpdateError>
Expand description

Quiesce an owned service, compose Core M007, and restore lifecycle state based on the artifact result.

The existing registration must be Owned and either Running or Stopped. Preserve keeps a stopped service stopped after success. A rolled-back transaction restores the pre-update lifecycle state regardless of restore. RecoveryRequired suppresses automatic service starts. No registration install/refresh is performed. The service adapter uses Core’s transaction rollback rather than maintaining artifact backups of its own.

This entry point runs the unified commit engine under CommitEnginePolicy::default, the stricter of the two former engine copies’ behaviours. Use commit_with_lifecycle_with_engine_policy to select the named policy inputs explicitly.

§Errors

LifecycleUpdateError when the update cannot be completed safely: the policy is invalid, the service is not Owned, the commit engine could not commit, roll back, or restore the service to its pre-update state. The error carries the transaction disposition, the observed lifecycle state, and whether manual artifact recovery is required.