diff -Nru nova-12.0.0~b1/debian/changelog nova-12.0.0~b1/debian/changelog --- nova-12.0.0~b1/debian/changelog 2015-06-25 09:19:23.000000000 +0000 +++ nova-12.0.0~b1/debian/changelog 2015-07-06 10:53:58.000000000 +0000 @@ -1,3 +1,10 @@ +nova (2:12.0.0~b1-0ubuntu2) wily; urgency=medium + + * d/nova-compute.upstart.in: Fix (another) race between nova-compute and + neutron-ovs-cleanup (LP: #1471022). + + -- Edward Hope-Morley Mon, 06 Jul 2015 11:53:51 +0100 + nova (2:12.0.0~b1-0ubuntu1) wily; urgency=medium * New milestone for OpenStack Liberty. diff -Nru nova-12.0.0~b1/debian/nova-compute.upstart.in nova-12.0.0~b1/debian/nova-compute.upstart.in --- nova-12.0.0~b1/debian/nova-compute.upstart.in 2015-06-25 09:19:23.000000000 +0000 +++ nova-12.0.0~b1/debian/nova-compute.upstart.in 2015-07-06 10:53:58.000000000 +0000 @@ -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,10 +23,33 @@ 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