diff -Nru nova-2015.1.0/debian/changelog nova-2015.1.0/debian/changelog --- nova-2015.1.0/debian/changelog 2015-05-03 18:56:22.000000000 +0100 +++ nova-2015.1.0/debian/changelog 2015-07-03 18:58:40.000000000 +0100 @@ -1,3 +1,11 @@ +nova (1:2015.1.0-0ubuntu1hf1471022v20150703.0) vivid; 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:57:59 +0100 + nova (1:2015.1.0-0ubuntu1) vivid; urgency=medium * New upstream release for OpenStack Kilo. (LP: #1449744) diff -Nru nova-2015.1.0/debian/nova-compute.upstart.in nova-2015.1.0/debian/nova-compute.upstart.in --- nova-2015.1.0/debian/nova-compute.upstart.in 2015-05-03 18:56:22.000000000 +0100 +++ nova-2015.1.0/debian/nova-compute.upstart.in 2015-07-03 19:17:47.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 +