Skip to content

Commit

Permalink
gpu-setup: Tolerate empty pid files and pid file removal
Browse files Browse the repository at this point in the history
Because job-init is asynchronous to mxqd (see previous commit),
job-release rases with it, too.

Tolerate empty pid files as well as a pid files being removed away from
under us.
  • Loading branch information
donald committed Feb 17, 2022
1 parent 4bad691 commit 1d92659
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion helper/gpu-setup
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ job_release() {
test -d /dev/shm/mxqd/gpu_devs || die "$0: Not initialized (no dir /dev/shm/mxqd/gpu_devs)"
for d in /dev/shm/mxqd/gpu_devs/???; do
if [ -e $d/pid ]; then
test_pid=$(cat $d/pid)
test_pid="$(cat $d/pid 2>/dev/null)"
if [ "$pid" = "$test_pid" ]; then
rm $d/pid
for f in $(cat $d/access-files); do
Expand Down

0 comments on commit 1d92659

Please sign in to comment.