test that build farm locks are > 0 size
authorAndrew Bartlett <abartlet@samba.org>
Thu, 17 May 2012 01:56:35 +0000 (11:56 +1000)
committerAndrew Bartlett <abartlet@samba.org>
Thu, 17 May 2012 01:56:50 +0000 (11:56 +1000)
This does make the locks less atomic, but disk full situations are more common.

When the disk fills up, then the zero length file is created, and the host
drops out of the build farm.

Andrew Bartlett

build_test.fns

index 392180a6280a1971b3c33b833241d0ec0b9debbc..2358524ad9d35a3f991b852a1705d950fd886d57 100644 (file)
@@ -196,7 +196,9 @@ lock_file() {
                        return 0
                fi
 
-               if test -f "$lckf"; then
+               # We need to assert that the file is > 0 size, as otherwise we never
+                # recover from disk full situations
+               if test -f "$lckf" && test -s "$lckf"; then
                        test x$machine = x$host || {
                                echo "lock file $lckf is valid for other machine $machine"
                                return 1