From 7b80f69da0e5dc1bf87cd068304e7befe5c3ac6f Mon Sep 17 00:00:00 2001 From: Ian Wienand Date: Fri, 30 Jul 2021 10:34:20 +1000 Subject: [PATCH] hound: clear git lockfiles before starting daemon If the hound service is shutdown uncleanly (like the server stops on us) it can leave behind lock files that stop processing. Clear old lock files on start before indexing begins. Also fix the job matching Change-Id: I6e6c57d7121702eb61124c3d4c4cdc7afd3e75c3 --- docker/hound/start-container.sh | 3 +++ zuul.d/system-config-run.yaml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/docker/hound/start-container.sh b/docker/hound/start-container.sh index 33be187aa9..d02d973a92 100755 --- a/docker/hound/start-container.sh +++ b/docker/hound/start-container.sh @@ -5,5 +5,8 @@ else if [ ! -f /var/run/config.json ]; then update-hound-config; fi + # Unclean shutdown can leave lockfiles that stop processing, + # cleanup. + find . -type f \( -wholename "*/.git/index.lock" -o -wholename "*/.git/shallow.lock" \) -delete -print /usr/local/bin/supervisord -c /etc/supervisor/conf.d/supervisord.conf fi diff --git a/zuul.d/system-config-run.yaml b/zuul.d/system-config-run.yaml index 5350126715..7c866f5911 100644 --- a/zuul.d/system-config-run.yaml +++ b/zuul.d/system-config-run.yaml @@ -488,7 +488,7 @@ - playbooks/roles/codesearch/ - playbooks/roles/install-docker/ - playbooks/roles/pip3/ - - docker/codesearch/ + - docker/hound/ - testinfra/test_codesearch.py - job: