Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
tmpdir-setup: Don't umount in background
The old cleanup code runs in the background, which is okay for normal
operations. However when mxqd restarts and finds jobs, which have
finished in the meantime, it calls the tmpdir cleanup code for theses jobs.

Later during recovery, it scans the spool area for other remaining
tmpdir mounts and calls the cleanup code for these. This races with the
oridnary cleanup when it is asynchronous.

This bug exists in 0.30.7 and has nothing to do with the current
changes. It is only triggered when a restarting mxqd finds completed
jobs. There is no harm done, the jobs complete normally, the tmpdir is
cleand up. The second attempted cleanup just produces some error
messages in the log. Without any other side effects.

As the "old style" tmpdir setup is going away anyway, don't invent
something complicated here and just do the cleanup synchronously.
  • Loading branch information
donald committed Oct 28, 2022
1 parent b249091 commit 1d11d14
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions helper/tmpdir-setup
Expand Up @@ -61,12 +61,10 @@ cmd_cleanup() {
# Support rolling upgrade: Use old code if loop device is directly mounted without a dm device in between.
#
if [[ $(findmnt --output SOURCE --noheadings /dev/shm/mxqd/mnt/job/$MXQ_JOBID) =~ ^/dev/loop ]]; then
(
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
exit
fi

Expand Down

0 comments on commit 1d11d14

Please sign in to comment.