From c96b7e224aa0d7c42524a7663394816e2a0635ce Mon Sep 17 00:00:00 2001 From: barrierye Date: Tue, 11 Aug 2020 20:40:38 +0800 Subject: [PATCH] bug fix --- python/pipeline/dag.py | 3 ++- python/pipeline/operator.py | 5 +++-- python/pipeline/pipeline_server.py | 7 ++++--- python/pipeline/profiler.py | 2 +- python/pipeline/util.py | 1 + 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/python/pipeline/dag.py b/python/pipeline/dag.py index b115bdb3..0e058dbe 100644 --- a/python/pipeline/dag.py +++ b/python/pipeline/dag.py @@ -559,7 +559,8 @@ class DAG(object): self._pack_func = pack_func self._unpack_func = unpack_func - self._tracer.set_channels(self._channels) + if self._tracer is not None: + self._tracer.set_channels(self._channels) return self._input_channel, self._output_channel, self._pack_func, self._unpack_func diff --git a/python/pipeline/operator.py b/python/pipeline/operator.py index 69beef0f..3d47dd68 100644 --- a/python/pipeline/operator.py +++ b/python/pipeline/operator.py @@ -364,8 +364,9 @@ class Op(object): input_offset.append(offset) else: _LOGGER.critical( - "{} Failed to process: expect input type is dict or listi" - ", but get {}".format(op_info_prefix, type(one_input))) + "{} Failed to process: expect input type is dict(sample" + " input) or list(batch input), but get {}".format( + op_info_prefix, type(one_input))) os._exit(-1) midped_batch = None diff --git a/python/pipeline/pipeline_server.py b/python/pipeline/pipeline_server.py index 04d2c4fc..ca8954aa 100644 --- a/python/pipeline/pipeline_server.py +++ b/python/pipeline/pipeline_server.py @@ -92,8 +92,9 @@ class PipelineServer(object): json.dumps( conf, indent=4, separators=(',', ':')))) if self._build_dag_each_worker is True: - _LOGGER.info( - "(Make sure that install grpcio whl with --no-binary flag)") + _LOGGER.warning( + "(Make sure that install grpcio whl with --no-binary flag: " + "pip install grpcio --no-binary grpcio)") _LOGGER.info("-------------------------------------------") self._conf = conf @@ -181,7 +182,7 @@ class ServerYamlConfChecker(object): @staticmethod def check_tracer_conf(conf): - default_conf = {"interval_s": 600, } + default_conf = {"interval_s": -1, } conf_type = {"interval_s": int, } diff --git a/python/pipeline/profiler.py b/python/pipeline/profiler.py index e5066163..cfc56ca2 100644 --- a/python/pipeline/profiler.py +++ b/python/pipeline/profiler.py @@ -130,7 +130,7 @@ class PerformanceTracer(object): _LOGGER.info("\tQuery count[{}]".format(tot)) _LOGGER.info("\tQPS[{} q/s]".format(qps)) _LOGGER.info("\tSucc[{}]".format(1 - 1.0 * err_count / tot)) - _LOGGER.info("\tError req[{}]".format([", ".join([str(x) for x in err_request])])) + _LOGGER.info("\tError req[{}]".format(", ".join([str(x) for x in err_request)])) _LOGGER.info("\tLatency:") _LOGGER.info("\t\tave[{} ms]".format(ave_cost)) for latency in latencys: diff --git a/python/pipeline/util.py b/python/pipeline/util.py index ac64a7c6..fb5e14ce 100644 --- a/python/pipeline/util.py +++ b/python/pipeline/util.py @@ -16,6 +16,7 @@ import sys import logging import threading import multiprocessing +import multiprocessing.managers if sys.version_info.major == 2: import Queue from Queue import PriorityQueue -- GitLab