Don't fail on failure to lock

Instead of failing outright on failure to lock a repo, sleep for 5
seconds and put it back into queue to retry again.

Signed-off-by: Konstantin Ryabitsev <>
diff --git a/grokmirror/ b/grokmirror/
index 77cfa1c..fcd8667 100755
--- a/grokmirror/
+++ b/grokmirror/
@@ -256,8 +256,10 @@
             grokmirror.lock_repo(fullpath, nonblocking=True)
         except IOError:
-            # Let the next run deal with this one
-            q_done.put((gitdir, repoinfo, q_action, False))
+            # Take a quick nap and put it back into queue
+  '    defer: %s (locked)', gitdir)
+            time.sleep(5)
+            q_pull.put((gitdir, repoinfo, action, q_action))
         if action == 'purge':