diff -Nru nova-2014.2.3/debian/changelog nova-2014.2.3/debian/changelog --- nova-2014.2.3/debian/changelog 2015-05-08 16:03:34.000000000 +0100 +++ nova-2014.2.3/debian/changelog 2015-07-03 18:57:39.000000000 +0100 @@ -1,3 +1,11 @@ +nova (1:2014.2.3-0ubuntu1hf1471022v20150703.0) utopic; urgency=medium + + [ Edward Hope-Morley ] + * d/nova-compute.upstart + - Fix (another) race between nova-compute and neutron-ovs-cleanup (LP: #1471022) + + -- Edward Hope-Morley Fri, 03 Jul 2015 18:56:33 +0100 + nova (1:2014.2.3-0ubuntu1) utopic; urgency=medium * Resynchronize with stable/juno (4fdd83f) (LP: #1443429) diff -Nru nova-2014.2.3/debian/nova-compute.upstart nova-2014.2.3/debian/nova-compute.upstart --- nova-2014.2.3/debian/nova-compute.upstart 2015-05-08 16:03:34.000000000 +0100 +++ nova-2014.2.3/debian/nova-compute.upstart 2015-07-03 18:55:40.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 +