From 9aea8fac9a58b9d83d9a8ca8eb852178f9bd534e Mon Sep 17 00:00:00 2001 From: Donald Buczek Date: Fri, 28 Oct 2022 11:31:44 +0200 Subject: [PATCH] tmpdir-setup: Don't cleanup asynchronously When mxqd restarts and finds finished jobs, it calls the tmpdir cleanup code for these jobs. As part of the recovery procedure, it later scans the system for any leftover mounts. When the regular tmpdir cleanup is done asynchronously, mxqd might discover a directory which is in the progress of being dismounted but still exists in which case it calls the tmpdir cleanup code a second time. There is no harm done, the jobs completed normally. The second attempted cleanup just produces some error messages in the logfile This bug is only triggered when jobs complete while mxqd is stopped. As the "old style" tmpdir setup is going away anyway, don't invent something complicated here and just do the cleanup synchronously. --- helper/tmpdir-setup | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/helper/tmpdir-setup b/helper/tmpdir-setup index fe47dc79..d79c1a53 100755 --- a/helper/tmpdir-setup +++ b/helper/tmpdir-setup @@ -52,12 +52,10 @@ cmd_cleanup() { (( $# == 1 )) || usage MXQ_JOBID=$1 - ( - shopt -s dotglob; - rm -rf /dev/shm/mxqd/mnt/job/$MXQ_JOBID/* - umount /dev/shm/mxqd/mnt/job/$MXQ_JOBID - rmdir /dev/shm/mxqd/mnt/job/$MXQ_JOBID - ) & + shopt -s dotglob; + rm -rf /dev/shm/mxqd/mnt/job/$MXQ_JOBID/* + umount /dev/shm/mxqd/mnt/job/$MXQ_JOBID + rmdir /dev/shm/mxqd/mnt/job/$MXQ_JOBID } (( $# > 0 )) || usage