Signal handling
This commit is contained in:
parent
54291918bf
commit
3c0e23574d
|
@ -70,6 +70,8 @@ def signal_handler(signal, frame):
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
if "PoolWorker" in process.name:
|
if "PoolWorker" in process.name:
|
||||||
raise SystemExit
|
raise SystemExit
|
||||||
|
if process.name == "ForkingSolver":
|
||||||
|
return
|
||||||
if threading.current_thread().name not in ("PyBitmessage", "MainThread"):
|
if threading.current_thread().name not in ("PyBitmessage", "MainThread"):
|
||||||
return
|
return
|
||||||
logger.error("Got signal %i", signal)
|
logger.error("Got signal %i", signal)
|
||||||
|
|
|
@ -89,7 +89,12 @@ class ForkingSolver(object):
|
||||||
for i in xrange(len(self.processes), parallelism):
|
for i in xrange(len(self.processes), parallelism):
|
||||||
local, remote = multiprocessing.Pipe()
|
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()
|
process.start()
|
||||||
|
|
||||||
remote.close()
|
remote.close()
|
||||||
|
|
|
@ -109,11 +109,11 @@ class TestDumbSolver(TestSolver):
|
||||||
|
|
||||||
class TestForkingSolver(TestSolver):
|
class TestForkingSolver(TestSolver):
|
||||||
Solver = forkingsolver.ForkingSolver
|
Solver = forkingsolver.ForkingSolver
|
||||||
configuration = 1
|
configuration = 3
|
||||||
|
|
||||||
class TestFastSolver(TestSolver):
|
class TestFastSolver(TestSolver):
|
||||||
Solver = fastsolver.FastSolver
|
Solver = fastsolver.FastSolver
|
||||||
configuration = 1
|
configuration = 3
|
||||||
|
|
||||||
class TestGPUSolver(TestSolver):
|
class TestGPUSolver(TestSolver):
|
||||||
Solver = gpusolver.GPUSolver
|
Solver = gpusolver.GPUSolver
|
||||||
|
|
Loading…
Reference in New Issue
Block a user