Commit ea548968 authored by David Johnson's avatar David Johnson

Patch oslo.service to avoid nasty hangs on service stop.

Apparently oslo.service handles stop signals (like those from systemd)
in a bad way.  When systemd stops a service, it can drive the service
into an exception (in one of its threads, I think) and I assume systemd
waits until its timeout and then kills it more firmly.  This patch went
in to oslo.service 1.2.0 or so, but of course we're stuck back in the
stone age still, around 0.9 or whatever.  So apply the patch, stupid.
We start and stop services a lot as we're setting up.
parent 5ba614bf
--- /usr/lib/python2.7/dist-packages/oslo_service/service.py~ 2015-08-31 16:57:53.000000000 -0600
+++ /usr/lib/python2.7/dist-packages/oslo_service/service.py 2016-02-17 16:00:05.611235965 -0700
@@ -352,11 +352,11 @@
# Setup child signal handlers differently
def _sigterm(*args):
- SignalHandler().clear()
+ self.signal_handler.clear()
self.launcher.stop()
def _sighup(*args):
- SignalHandler().clear()
+ self.signal_handler.clear()
raise SignalExit(signal.SIGHUP)
self.signal_handler.clear()
......@@ -29,6 +29,15 @@ if [ -f $SETTINGS ]; then
. $SETTINGS
fi
#
# This is a nasty bug in oslo_service; see
# https://review.openstack.org/#/c/256267/
#
if [ $OSVERSION -ge $OSKILO ]; then
maybe_install_packages python-oslo.service
patch -d / -p0 < $DIRNAME/etc/oslo_service-liberty-sig-MAINLOOP.patch
fi
maybe_install_packages nova-compute sysfsutils
maybe_install_packages libguestfs-tools libguestfs0 python-guestfs
......
......@@ -60,7 +60,8 @@ __openstack() {
# Setup mail to users
#
maybe_install_packages dma
echo `hostname` > /etc/mailname
echo "$PFQDN" > /etc/mailname
sleep 2
echo "Your OpenStack instance is setting up on `hostname` ." \
| mail -s "OpenStack Instance Setting Up" ${SWAPPER_EMAIL} &
......@@ -71,6 +72,15 @@ if [ $OSVERSION -ge $OSKILO ]; then
maybe_install_packages python-openstackclient
fi
#
# This is a nasty bug in oslo_service; see
# https://review.openstack.org/#/c/256267/
#
if [ $OSVERSION -ge $OSKILO ]; then
maybe_install_packages python-oslo.service
patch -d / -p0 < $DIRNAME/etc/oslo_service-liberty-sig-MAINLOOP.patch
fi
#
# Install the database
#
......
......@@ -27,6 +27,15 @@ if [ -f $SETTINGS ]; then
. $SETTINGS
fi
#
# This is a nasty bug in oslo_service; see
# https://review.openstack.org/#/c/256267/
#
if [ $OSVERSION -ge $OSKILO ]; then
maybe_install_packages python-oslo.service
patch -d / -p0 < $DIRNAME/etc/oslo_service-liberty-sig-MAINLOOP.patch
fi
# Grab the neutron configuration we computed in setup-lib.sh
. $OURDIR/neutron.vars
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment