Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
donald committed Oct 28, 2022
1 parent 4285d95 commit 0b1a29f
Showing 1 changed file with 4 additions and 6 deletions.
10 changes: 4 additions & 6 deletions helper/tmpdir-setup
Expand Up @@ -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
Expand Down

0 comments on commit 0b1a29f

Please sign in to comment.