summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAdriana Kobylak <anoo@us.ibm.com>2018-01-24 14:19:24 -0600
committerAdriana Kobylak <anoo@us.ibm.com>2018-01-24 14:37:50 -0600
commit8bd84c8b24a425cf16eb593d8b245b2b8ed11b5f (patch)
tree4dbf372cd2d3e5c292c9812ebceeb128ba17db44
parent00bd9029eb06acf34d446c17db4af27a07c52fe0 (diff)
downloadphosphor-bmc-code-mgmt-8bd84c8b24a425cf16eb593d8b245b2b8ed11b5f.tar.gz
phosphor-bmc-code-mgmt-8bd84c8b24a425cf16eb593d8b245b2b8ed11b5f.zip
Avoid calling Activation repeatedly during update
The Activation code monitors the systemd service files that create the volumes, and sets the value to Activating if the services are running, or Failed if they fail. This monitoring code checks the name of the service file for when it fails, but it wasn't checking it for when it succeeds, leading to any systemd file that finished to trigger calling the Activation function multiple times. Also avoid removing the Priority object if the requested Activation value is Activating, since that's what the value the monitoring code calls during the update. Part of openbmc/openbmc#2764 Change-Id: Ib6681ce5d63d184a2ee9ffe05c083e1085efd2ac Signed-off-by: Adriana Kobylak <anoo@us.ibm.com>
-rw-r--r--activation.cpp23
1 files changed, 13 insertions, 10 deletions
diff --git a/activation.cpp b/activation.cpp
index 72cc212..ecfcda4 100644
--- a/activation.cpp
+++ b/activation.cpp
@@ -41,7 +41,8 @@ auto Activation::activation(Activations value) ->
Activations
{
- if (value != softwareServer::Activation::Activations::Active)
+ if ((value != softwareServer::Activation::Activations::Active) &&
+ (value != softwareServer::Activation::Activations::Activating))
{
redundancyPriority.reset(nullptr);
}
@@ -212,16 +213,18 @@ void Activation::unitStateChange(sdbusplus::message::message& msg)
activationProgress->progress(activationProgress->progress() + 50);
}
- if (rwVolumeCreated && roVolumeCreated)
+ if (newStateUnit == rwServiceFile || newStateUnit == roServiceFile)
{
- Activation::activation(
- softwareServer::Activation::Activations::Activating);
- }
-
- if ((newStateUnit == rwServiceFile || newStateUnit == roServiceFile) &&
- (newStateResult == "failed" || newStateResult == "dependency"))
- {
- Activation::activation(softwareServer::Activation::Activations::Failed);
+ if (newStateResult == "failed" || newStateResult == "dependency")
+ {
+ Activation::activation(
+ softwareServer::Activation::Activations::Failed);
+ }
+ else if (rwVolumeCreated && roVolumeCreated)
+ {
+ Activation::activation(
+ softwareServer::Activation::Activations::Activating);
+ }
}
return;
OpenPOWER on IntegriCloud