From 2462f3015a5601a9398400beef2fadc56cbaa89f Mon Sep 17 00:00:00 2001 From: Tao Liu Date: Sat, 12 Jan 2019 23:21:53 -0500 Subject: [PATCH] Clean up the stale files The keystone-api pod gets stuck in CrashLoopBackOff on AIO-SX lock/unlock attempt. When Kubernetes decides to kill the keystone-api pod due to readiness probe failure or other reasons, it calls the preStop hook immediately before the container is terminated. This hook starts a graceful shutdown process which includes removing pid, shared memory segment and wsgi sock files. If the container is not terminated within the grace period, a SIGKILL is sent, and the container is forced to shut down. When the container was forced to terminate without clean up, the stale files were left behind. On the restart, the application detected the file existed, and treated it as configuration failure, hence the exit. As a result, the pod went into a crash loop. This update removes any stale files when the pod starts. Story: 2004520 Task: 28392 Change-Id: I613a0db674de9578b3f9d1fa781a1612d9caf214 Signed-off-by: Tao Liu --- openstack/openstack-helm/centos/build_srpm.data | 2 +- .../Remove-stale-Apache2-service-pids-when-a-POD-starts.patch | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/openstack/openstack-helm/centos/build_srpm.data b/openstack/openstack-helm/centos/build_srpm.data index da17aaf7..2bcbdedb 100644 --- a/openstack/openstack-helm/centos/build_srpm.data +++ b/openstack/openstack-helm/centos/build_srpm.data @@ -5,4 +5,4 @@ TAR="$TAR_NAME-$SHA.tar.gz" COPY_LIST="${CGCS_BASE}/downloads/$TAR $PKG_BASE/files/* " -TIS_PATCH_VER=6 +TIS_PATCH_VER=7 diff --git a/openstack/openstack-helm/files/Remove-stale-Apache2-service-pids-when-a-POD-starts.patch b/openstack/openstack-helm/files/Remove-stale-Apache2-service-pids-when-a-POD-starts.patch index 78814baa..29b4c913 100644 --- a/openstack/openstack-helm/files/Remove-stale-Apache2-service-pids-when-a-POD-starts.patch +++ b/openstack/openstack-helm/files/Remove-stale-Apache2-service-pids-when-a-POD-starts.patch @@ -56,8 +56,8 @@ index 217d942..a5950a4 100644 source /etc/apache2/envvars fi -+ # Get rid of stale pid file if present. -+ rm -f /var/run/apache2/*.pid ++ # Get rid of stale pid, shared memory segment and wsgi sock files if present. ++ rm -f /var/run/apache2/* + # Start Apache2 exec apache2 -DFOREGROUND