Code Review
/
yardstick.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Merge changes from topics 'feat/keep_vnf', 'YARDSTICK-886'
[yardstick.git]
/
yardstick
/
benchmark
/
runners
/
sequence.py
diff --git
a/yardstick/benchmark/runners/sequence.py
b/yardstick/benchmark/runners/sequence.py
index
68e272c
..
d6e3f71
100644
(file)
--- a/
yardstick/benchmark/runners/sequence.py
+++ b/
yardstick/benchmark/runners/sequence.py
@@
-21,11
+21,13
@@
The input value in the sequence is specified in a list in the input file.
"""
from __future__ import absolute_import
"""
from __future__ import absolute_import
-import os
-import multiprocessing
+
import logging
import logging
-import
traceback
+import
multiprocessing
import time
import time
+import traceback
+
+import os
from yardstick.benchmark.runners import base
from yardstick.benchmark.runners import base
@@
-105,8
+107,18
@@
def _worker_process(queue, cls, method_name, scenario_cfg,
if (errors and sla_action is None) or aborted.is_set():
break
if (errors and sla_action is None) or aborted.is_set():
break
- benchmark.teardown()
+ try:
+ benchmark.teardown()
+ except Exception:
+ # catch any exception in teardown and convert to simple exception
+ # never pass exceptions back to multiprocessing, because some exceptions can
+ # be unpicklable
+ # https://bugs.python.org/issue9400
+ LOG.exception("")
+ raise SystemExit(1)
LOG.info("worker END")
LOG.info("worker END")
+ LOG.debug("queue.qsize() = %s", queue.qsize())
+ LOG.debug("output_queue.qsize() = %s", output_queue.qsize())
class SequenceRunner(base.Runner):
class SequenceRunner(base.Runner):
@@
-130,7
+142,9
@@
class SequenceRunner(base.Runner):
__execution_type__ = 'Sequence'
def _run_benchmark(self, cls, method, scenario_cfg, context_cfg):
__execution_type__ = 'Sequence'
def _run_benchmark(self, cls, method, scenario_cfg, context_cfg):
+ name = "{}-{}-{}".format(self.__execution_type__, scenario_cfg.get("type"), os.getpid())
self.process = multiprocessing.Process(
self.process = multiprocessing.Process(
+ name=name,
target=_worker_process,
args=(self.result_queue, cls, method, scenario_cfg,
context_cfg, self.aborted, self.output_queue))
target=_worker_process,
args=(self.result_queue, cls, method, scenario_cfg,
context_cfg, self.aborted, self.output_queue))