From 1aea8a472e725bf8ae2eb7e03dd15874193183d3 Mon Sep 17 00:00:00 2001 From: Kevin Veen-Birkenbach Date: Sat, 1 Aug 2026 18:24:07 +0200 Subject: [PATCH] test(nfs): make a wedged ganesha startup describable The role runs ganesha at -N NIV_EVENT, and roughly eighteen init steps between the CLIENT commits and the listener log below that level, so the silence in run 30699990912 marked the edge of visibility rather than the fault. Raise INIT and DISPATCH under MODE_DEBUG: nfs_Init_svc(), which binds 2049, logs under COMPONENT_DISPATCH, so INIT alone would have missed exactly the step in question. Add a userspace backtrace beside the kernel stack dump, which only ever says futex_do_wait. eu-stack names the function holding the lock; elfutils goes into the lab image rather than the role, since a production NFS server should not carry a debugger. Co-Authored-By: Claude Opus 5 (1M context) --- compose/swarm/Dockerfile | 6 +++--- .../svc-storage-nfs-server/templates/ganesha.conf.j2 | 9 +++++++++ .../tests/deploy/swarm/utils/collect/diagnostics.sh | 12 ++++++++++++ 3 files changed, 24 insertions(+), 3 deletions(-) diff --git a/compose/swarm/Dockerfile b/compose/swarm/Dockerfile index 5c5c773de2..5e70fa0d79 100644 --- a/compose/swarm/Dockerfile +++ b/compose/swarm/Dockerfile @@ -22,14 +22,14 @@ FROM ${INFINITO_IMAGE} RUN set -eux; \ if command -v apt-get >/dev/null 2>&1; then \ apt-get update -qq; \ - apt-get install -y -qq --no-install-recommends dnsmasq openssh-server cryptsetup e2fsprogs; \ + apt-get install -y -qq --no-install-recommends dnsmasq openssh-server cryptsetup e2fsprogs elfutils; \ rm -rf /var/lib/apt/lists/*; \ elif command -v dnf >/dev/null 2>&1; then \ - dnf install -y dnsmasq openssh-server cryptsetup e2fsprogs; \ + dnf install -y dnsmasq openssh-server cryptsetup e2fsprogs elfutils; \ dnf clean all; \ elif command -v pacman >/dev/null 2>&1; then \ pacman -Sy --noconfirm --needed archlinux-keyring; \ - pacman -Syu --noconfirm --needed dnsmasq openssh cryptsetup e2fsprogs; \ + pacman -Syu --noconfirm --needed dnsmasq openssh cryptsetup e2fsprogs elfutils; \ rm -rf /var/cache/pacman/pkg/*; \ else \ echo "no supported package manager (apt/dnf/pacman)" >&2; exit 1; \ diff --git a/roles/svc-storage-nfs-server/templates/ganesha.conf.j2 b/roles/svc-storage-nfs-server/templates/ganesha.conf.j2 index 4e42e12609..10b22ea5fe 100644 --- a/roles/svc-storage-nfs-server/templates/ganesha.conf.j2 +++ b/roles/svc-storage-nfs-server/templates/ganesha.conf.j2 @@ -1,4 +1,13 @@ # Managed by Ansible role svc-storage-nfs-server (flavor: ganesha / FSAL_VFS). +{% if MODE_DEBUG | bool %} +LOG { + components { + INIT = FULL_DEBUG; + DISPATCH = DEBUG; + } +} + +{% endif %} NFS_CORE_PARAM { Protocols = 4; Enable_NLM = false; diff --git a/scripts/tests/deploy/swarm/utils/collect/diagnostics.sh b/scripts/tests/deploy/swarm/utils/collect/diagnostics.sh index e2990acbd2..3e0e8d9777 100755 --- a/scripts/tests/deploy/swarm/utils/collect/diagnostics.sh +++ b/scripts/tests/deploy/swarm/utils/collect/diagnostics.sh @@ -98,6 +98,18 @@ for t in /proc/${pid}/task/*; do cat ${t}/stack 2>&1 done' +sep "ganesha-userstack" "nfs-server: ganesha userspace backtrace (the kernel stack only says futex; this says whose lock)" +# shellcheck disable=SC2016 +dexec "${NFS_SERVER}" sh -c 'pid=$(systemctl show -p MainPID --value nfs-ganesha 2>/dev/null) +[ "${pid:-0}" -gt 0 ] || { echo "(nfs-ganesha reports no main pid)"; exit 0; } +if command -v eu-stack >/dev/null 2>&1; then + eu-stack -p "${pid}" 2>&1 +elif command -v gdb >/dev/null 2>&1; then + gdb -p "${pid}" -batch -ex "thread apply all bt" 2>&1 +else + echo "(neither eu-stack nor gdb is installed on this node)" +fi' + sep "controller-nfs" "controller (this runner): NFS reachability of nfs-server" _nfs_ip="$(docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}} {{end}}' "${NFS_SERVER}")" echo "nfs-server container IP(s): ${_nfs_ip}"