Skip to content

Commit

Permalink
My lock got stuck
Browse files Browse the repository at this point in the history
  • Loading branch information
ChillerDragon committed Nov 12, 2024
1 parent f8eda45 commit 105a20a
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions lib/include/build_lock.sh
Original file line number Diff line number Diff line change
Expand Up @@ -85,12 +85,22 @@ function _cleanup_stale_locks() {
path="$(printf '%s\n' "$lock_entry" | awk '{ print $1 }')"
uuid="$(printf '%s\n' "$lock_entry" | awk '{ print $2 }')"
pid="$(printf '%s\n' "$lock_entry" | awk '{ print $3 }')"

if [ "$pid" = "" ]
then
wrn "WARNING: the lock owner pid is empty. This is a bug!"
wrn " please check build_lock.sh and add some cleanup code"
return
fi

if ! ps "$pid" >/dev/null
then
wrn "WARNING: the pid $pid holding the build lock is not running"
wrn " removed the lock entry ..."

_remove_build_lock "^$path $uuid $pid "
else
log "the pid '$pid' is holdig the lock and still running"
fi
done < "$BUILD_LOCKFILE"
}
Expand Down

0 comments on commit 105a20a

Please sign in to comment.