Commit 455d59fd authored by Arnaud Fontaine's avatar Arnaud Fontaine

When a child exits with an error, kill the other processes

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk/utils@46016 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 922a597b
......@@ -230,8 +230,9 @@ class PerformanceTester(object):
interrupted_counter += 1
for process in process_list:
if (not getattr(process, '_stopping', False) or
interrupted_counter == MAXIMUM_KEYBOARD_INTERRUPT):
if (process.is_alive() and
(not getattr(process, '_stopping', False) or
interrupted_counter == MAXIMUM_KEYBOARD_INTERRUPT)):
process._stopping = True
process.terminate()
......@@ -247,6 +248,15 @@ class PerformanceTester(object):
if error_message is not None:
error_message_set.add(error_message)
# In case of error, kill the other children because they are likely
# failing as well (especially because a process only exits after
# encountering 10 errors)
if interrupted_counter == 0:
for process in process_list:
if process.is_alive() and not getattr(process, '_stopping', False):
process._stopping = True
process.terminate()
if error_message_set:
return (error_message_set, 1)
......
......@@ -56,7 +56,8 @@ class BenchmarkProcess(multiprocessing.Process):
super(BenchmarkProcess, self).__init__(*args, **kwargs)
def stopGracefully(self, *args, **kwargs):
raise StopIteration("Interrupted by user, flushing remaining results...")
raise StopIteration("Interrupted by user or because of an error from "
"another process, flushing remaining results...")
def getBrowser(self, log_file):
info_list = tuple(self._argument_namespace.url) + \
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment