diff -Nru nova-2014.1.5/debian/changelog nova-2014.1.5/debian/changelog --- nova-2014.1.5/debian/changelog 2015-06-23 01:59:06.000000000 +0100 +++ nova-2014.1.5/debian/changelog 2015-07-08 15:35:03.000000000 +0100 @@ -1,3 +1,11 @@ +nova (1:2014.1.5-0ubuntu1hf1471022v20150708.0) trusty; urgency=medium + + [ Edward Hope-Morley ] + - d/nova-compute.upstart: Fix (another) race between nova-compute + and neutron-ovs-cleanup (LP: #1471022) + + -- Edward Hope-Morley Wed, 08 Jul 2015 15:33:10 +0100 + nova (1:2014.1.5-0ubuntu1) trusty; urgency=medium * Resynchronize with stable/icehouse (08b5d48) (LP: #1467533): diff -Nru nova-2014.1.5/debian/nova-compute.upstart nova-2014.1.5/debian/nova-compute.upstart --- nova-2014.1.5/debian/nova-compute.upstart 2015-06-23 01:59:06.000000000 +0100 +++ nova-2014.1.5/debian/nova-compute.upstart 2015-07-08 15:32:57.000000000 +0100 @@ -7,6 +7,8 @@ chdir /var/run +env MAX_STATUS_CHECK_RETRIES=20 + pre-start script mkdir -p /var/run/nova chown nova:root /var/run/nova/ @@ -21,11 +23,35 @@ start wait-for-state WAIT_FOR=libvirt-bin WAIT_STATE=running WAITER=nova-compute fi - # Check to see if openvswitch plugin in use by checking - # status of cleanup upstart configuration + # If installed, wait for neutron-ovs-cleanup to complete prior to starting + # nova-compute. if status neutron-ovs-cleanup; then - start wait-for-state WAIT_FOR=neutron-ovs-cleanup WAIT_STATE=running WAITER=nova-compute + # See LP #1471022 for explanation of why we do like this + retries=$MAX_STATUS_CHECK_RETRIES + delay=1 + while true; do + # Already running? + s=`status neutron-ovs-cleanup` + echo $s + `echo $s| grep -qE "\sstart/running"` && break + if retries=`expr $retries - 1`; then + # Give it a push + echo "Attempting to start neutron-ovs-cleanup" + start neutron-ovs-cleanup || : + # Wait a bit to avoid hammering ovs-cleanup (which itself may be waiting + # on dependencies) + echo "Recheck neutron-ovs-cleanup status in ${delay}s" + sleep $delay + if _=`expr $retries % 2`; then + delay=`expr $delay + 2` + fi + else + echo "Max retries ($MAX_STATUS_CHECK_RETRIES) reached - no longer waiting for neutron-ovs-cleanup to start" + break + fi + done fi end script exec start-stop-daemon --start --chuid nova --exec /usr/bin/nova-compute -- --config-file=/etc/nova/nova.conf --config-file=/etc/nova/nova-compute.conf +