]> Cypherpunks.ru repositories - goredo.git/blobdiff - run.go
EDEADLK is regular non-warning error
[goredo.git] / run.go
diff --git a/run.go b/run.go
index 566f7adbab83e52a191ed2498777d26267630bff..0bc3155661143249eef83b592e69d0506c980090 100644 (file)
--- a/run.go
+++ b/run.go
@@ -242,15 +242,13 @@ 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 {
-                               time.Sleep(10 * time.Millisecond)
-                               takeTries++
-                               if takeTries%10 == 0 {
-                                       log.Println(err, fdLock.Name(), "after", takeTries, "attempts")
+                               if errors.Is(err, unix.EDEADLK) {
+                                       time.Sleep(10 * time.Millisecond)
+                                       goto LockAgain
                                }
-                               goto LockAgain
+                               log.Fatalln(err, fdLock.Name())
                        }
                        lockRelease()
                        tracef(CDebug, "waiting done: %s", tgtOrig)