Signal handling
This commit is contained in:
parent
54291918bf
commit
3c0e23574d
|
@ -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)
|
||||
|
|
|
@ -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()
|
||||
|
|
|
@ -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
|
||||
|
|
Reference in New Issue
Block a user