]> Cypherpunks.ru repositories - goredo.git/blobdiff - run.go
Warn about several unsuccessful lock attempts
[goredo.git] / run.go
diff --git a/run.go b/run.go
index 7ee463714ed229448325014944d91c9fab266d18..566f7adbab83e52a191ed2498777d26267630bff 100644 (file)
--- a/run.go
+++ b/run.go
@@ -242,10 +242,14 @@ func runScript(tgtOrig string, errs chan error, forced, traced bool) error {
                go func() {
                        defer Jobs.Done()
                        tracef(CLock, "LOCK_EX: %s", fdLock.Name())
+                       takeTries := 0
                LockAgain:
                        if err := unix.FcntlFlock(fdLock.Fd(), unix.F_SETLKW, &flock); err != nil {
-                               log.Println(err, fdLock.Name())
                                time.Sleep(10 * time.Millisecond)
+                               takeTries++
+                               if takeTries%10 == 0 {
+                                       log.Println(err, fdLock.Name(), "after", takeTries, "attempts")
+                               }
                                goto LockAgain
                        }
                        lockRelease()