diff --git a/src/helper_generic.py b/src/helper_generic.py index ce56a292..5f76b484 100644 --- a/src/helper_generic.py +++ b/src/helper_generic.py @@ -70,6 +70,8 @@ def signal_handler(signal, frame): raise SystemExit if "PoolWorker" in process.name: raise SystemExit + if process.name == "ForkingSolver": + return if threading.current_thread().name not in ("PyBitmessage", "MainThread"): return logger.error("Got signal %i", signal) diff --git a/src/workprover/forkingsolver.py b/src/workprover/forkingsolver.py index 8eef3553..8813453c 100644 --- a/src/workprover/forkingsolver.py +++ b/src/workprover/forkingsolver.py @@ -89,7 +89,12 @@ class ForkingSolver(object): for i in xrange(len(self.processes), parallelism): local, remote = multiprocessing.Pipe() - process = multiprocessing.Process(target = threadFunction, args = (remote, local, self.codePath, i)) + process = multiprocessing.Process( + target = threadFunction, + args = (remote, local, self.codePath, i), + name = "ForkingSolver" + ) + process.start() remote.close() diff --git a/src/workprover/test.py b/src/workprover/test.py index 0c250ed8..e57c54b5 100755 --- a/src/workprover/test.py +++ b/src/workprover/test.py @@ -109,11 +109,11 @@ class TestDumbSolver(TestSolver): class TestForkingSolver(TestSolver): Solver = forkingsolver.ForkingSolver - configuration = 1 + configuration = 3 class TestFastSolver(TestSolver): Solver = fastsolver.FastSolver - configuration = 1 + configuration = 3 class TestGPUSolver(TestSolver): Solver = gpusolver.GPUSolver