summaryrefslogtreecommitdiffstats
path: root/cm-container/scripts/load-plugins.sh
diff options
context:
space:
mode:
authorJack Lucas <jflos@sonoris.net>2020-09-15 11:47:42 -0400
committerJack Lucas <jflos@sonoris.net>2020-09-15 14:53:54 -0400
commit8c530a4a5210f02fecaf600b3a9014c7feb75cf2 (patch)
tree71933f9395a707e7a2d2259004ce270c8511fa5b /cm-container/scripts/load-plugins.sh
parentfc26cac42b3a179a0473a46008902d8081eb2aa8 (diff)
Fix race condition for plugin uploads3.3.1
Issue-ID: DCAEGEN2-2430 Signed-off-by: Jack Lucas <jflos@sonoris.net> Change-Id: Id8809d7773d8e18d7106186a5772cb2709225fbb
Diffstat (limited to 'cm-container/scripts/load-plugins.sh')
-rwxr-xr-xcm-container/scripts/load-plugins.sh16
1 files changed, 16 insertions, 0 deletions
diff --git a/cm-container/scripts/load-plugins.sh b/cm-container/scripts/load-plugins.sh
index 5a342dd..c93f3d9 100755
--- a/cm-container/scripts/load-plugins.sh
+++ b/cm-container/scripts/load-plugins.sh
@@ -99,6 +99,22 @@ then
install_plugin ${wagons[0]} ${types[0]}
done
+ # The cfy plugin upload commands issued above will return
+ # before all of the processing is complete. The processing
+ # occurs in what Cloudify calls "system workflows", and if a
+ # system workflow is pending or running, other operations such
+ # as uploading a blueprint will fail. So we wait for any
+ # system workflows to finish before we create the PLUGINS_LOADED
+ # file and exit the script. That way, the bootstrap container
+ # (which waits for k8s to declare the CM container to be ready)
+ # will not try to upload blueprints while a system execution is
+ # underway. (See Jira DCAEGEN2-2430.)
+ while cm_hasany "executions?is_system_workflow=true&status=pending&status=started&status=queued&status=scheduled"
+ do
+ echo "Waiting for running system workflows to complete"
+ sleep 15
+ done
+
touch ${PLUGINS_LOADED}
else
echo "Plugins already loaded"