Signal handling

This commit is contained in:
Biryuzovye Kleshni 2018-06-30 09:55:53 +00:00
parent 54291918bf
commit 3c0e23574d
3 changed files with 10 additions and 3 deletions

View File

@ -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)

View File

@ -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()

View File

@ -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