From ef74d6313f01356c5a944ad472651f61e2b72c75 Mon Sep 17 00:00:00 2001 From: Davin McCall Date: Tue, 20 Feb 2018 10:19:06 +0000 Subject: [PATCH] Additional comment to better explain two-phase service transition. --- src/includes/service.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/includes/service.h b/src/includes/service.h index 50a488a..f80d4c1 100644 --- a/src/includes/service.h +++ b/src/includes/service.h @@ -84,6 +84,12 @@ * be set to STARTING or STOPPING to reflect the desired state, but will never be set to STARTED * or STOPPED (that happens in the execution phase). * + * The two-phase transition is needed to avoid problem where a service that becomes STOPPED has + * an incorrect acquisition count, which may cause it to restart when it should not. The + * propagation phase allows the acquisition count to settle before the transition to the STOPPED + * state occurs, and the decision whether to restart can then be made based on the (correct) + * acquisition count. + * * Propagation variables: * prop_acquire: the service has transitioned to an acquired state and must issue an acquire * on its dependencies -- 2.25.1