diff options
author | rameshiyer27 <ramesh.murugan.iyer@est.tech> | 2023-06-12 16:24:32 +0100 |
---|---|---|
committer | Adheli Tavares <adheli.tavares@est.tech> | 2023-06-14 13:08:07 +0000 |
commit | 1d1908528e67d9763482cf9d5921456f19af31e7 (patch) | |
tree | 3cfec9ca9027ba40c1b5d797625c9aa96020a9a6 /runtime-acm/src/main | |
parent | 73a48d9c7e599baf145820d0bc0968040142dac8 (diff) |
Add timeout for ACM operations
User can retry the ACM state change order when ACM operations time out.
Issue-ID: POLICY-4716
Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech>
Change-Id: Ie840fc13170ef235c6b6f3b26a47b7516f10296c
Diffstat (limited to 'runtime-acm/src/main')
-rw-r--r-- | runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScanner.java | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScanner.java b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScanner.java index 803bc86ca..41c7b1c74 100644 --- a/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScanner.java +++ b/runtime-acm/src/main/java/org/onap/policy/clamp/acm/runtime/supervision/SupervisionScanner.java @@ -31,6 +31,7 @@ import org.onap.policy.clamp.acm.runtime.supervision.comm.AutomationCompositionS import org.onap.policy.clamp.models.acm.concepts.AutomationComposition; import org.onap.policy.clamp.models.acm.concepts.DeployState; import org.onap.policy.clamp.models.acm.concepts.ParticipantUtils; +import org.onap.policy.clamp.models.acm.concepts.StateChangeResult; import org.onap.policy.clamp.models.acm.persistence.provider.AcDefinitionProvider; import org.onap.policy.clamp.models.acm.persistence.provider.AutomationCompositionProvider; import org.onap.policy.clamp.models.acm.utils.AcmUtils; @@ -111,6 +112,13 @@ public class SupervisionScanner { return; } + if (automationCompositionCounter.isFault(automationComposition.getInstanceId()) + && StateChangeResult.NO_ERROR.equals(automationComposition.getStateChangeResult())) { + // retry by the user + LOGGER.debug("clearing fault for the ac instance"); + clearFaultAndCounter(automationComposition); + } + var completed = true; var minSpNotCompleted = 1000; // min startPhase not completed var maxSpNotCompleted = 0; // max startPhase not completed @@ -196,6 +204,9 @@ public class SupervisionScanner { } else { LOGGER.debug("report AutomationComposition fault"); automationCompositionCounter.setFault(instanceId); + LOGGER.debug("report timeout for the ac instance"); + automationComposition.setStateChangeResult(StateChangeResult.TIMEOUT); + automationCompositionProvider.updateAutomationComposition(automationComposition); } } } |