From 8cf3a2867cfaf99c0775b3480267a6c613aa7282 Mon Sep 17 00:00:00 2001 From: Wayne Witzel III Date: Tue, 18 Jul 2017 09:06:06 -0400 Subject: [PATCH] Set capacity to zero before shutting down older instances in the cluster. --- awx/main/tasks.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/awx/main/tasks.py b/awx/main/tasks.py index e260293142..6065d7c66b 100644 --- a/awx/main/tasks.py +++ b/awx/main/tasks.py @@ -195,6 +195,10 @@ def cluster_node_heartbeat(self): other_inst.version, inst.hostname, inst.version)) + # Set the capacity to zero to ensure no Jobs get added to this instance. + # The heartbeat task will reset the capacity to the system capacity after upgrade. + inst.capacity = 0 + inst.save() stop_local_services(['uwsgi', 'celery', 'beat', 'callback', 'fact'])