chiark / gitweb /
rhodes: Don't try to kill ourselves when zapping redundant workers.
authorMark Wooding <mdw@distorted.org.uk>
Sun, 28 May 2017 18:03:08 +0000 (19:03 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Mon, 19 Jun 2017 09:30:31 +0000 (10:30 +0100)
For some reason the old code didn't actually break, but it seems like a
bad idea to try.

rhodes

diff --git a/rhodes b/rhodes
index 90876f1..b9d97fa 100755 (executable)
--- a/rhodes
+++ b/rhodes
@@ -466,7 +466,8 @@ def step(dir, cmd, *args):
       ## we lose a bunch of work. :-(
       c.execute("""SELECT pid FROM workers WHERE p = ? AND k = ?""",
                 (str(p), k))
-      for pid, in c: maybe_kill_worker(dir, pid)
+      for pid, in c:
+        if pid != mypid: maybe_kill_worker(dir, pid)
       c.execute("""DELETE FROM workers WHERE p = ? AND k = ?""",
                 (str(p), k - 1))
       c.execute("""DELETE FROM points WHERE p = ? AND k = ?""",