From 1de6854af0765b2d36e1b32ecf634f25e657472f Mon Sep 17 00:00:00 2001 From: barriery Date: Fri, 31 Jul 2020 03:22:26 +0000 Subject: [PATCH] update code --- python/pipeline/channel.py | 8 ++++---- python/pipeline/operator.py | 12 ++++++++---- 2 files changed, 12 insertions(+), 8 deletions(-) diff --git a/python/pipeline/channel.py b/python/pipeline/channel.py index 8a03c30b..b04714a5 100644 --- a/python/pipeline/channel.py +++ b/python/pipeline/channel.py @@ -330,8 +330,8 @@ class ProcessChannel(object): def front(self, op_name=None, timeout=None): _LOGGER.debug( - self._log("{} try to get data[?]; timeout={}".format(op_name, - timeout))) + self._log("{} try to get data[?]; timeout(s)={}".format(op_name, + timeout))) endtime = None if timeout is not None: if timeout <= 0: @@ -603,8 +603,8 @@ class ThreadChannel(Queue.Queue): def front(self, op_name=None, timeout=None): _LOGGER.debug( - self._log("{} try to get data[?]; timeout={}".format(op_name, - timeout))) + self._log("{} try to get data[?]; timeout(s)={}".format(op_name, + timeout))) endtime = None if timeout is not None: if timeout <= 0: diff --git a/python/pipeline/operator.py b/python/pipeline/operator.py index eea153d4..2728c6e7 100644 --- a/python/pipeline/operator.py +++ b/python/pipeline/operator.py @@ -87,8 +87,9 @@ class Op(object): .format(self.name, self._batch_size)) self._batch_size = 1 if self._auto_batching_timeout != None: - _LOGGER.warn("Op({}) reset auto_batching_timeout=1 (original: {})" - .format(self.name, self._auto_batching_timeout)) + _LOGGER.warn( + "Op({}) reset auto_batching_timeout=None (original: {})" + .format(self.name, self._auto_batching_timeout)) self._auto_batching_timeout = None def use_profiler(self, use_profile): @@ -235,6 +236,9 @@ class Op(object): target=self._run, args=(concurrency_idx, self._get_input_channel(), self._get_output_channels(), client_type, True)) + # When a process exits, it attempts to terminate + # all of its daemonic child processes. + t.daemon = True t.start() threads.append(t) return threads @@ -310,7 +314,7 @@ class Op(object): _LOGGER.error(error_info) else: _LOGGER.warn( - log_func("timeout, retry({}/{})" + log_func("PaddleService timeout, retry({}/{})" .format(i + 1, self._retry))) except Exception as e: ecode = ChannelDataEcode.UNKNOW.value @@ -399,7 +403,7 @@ class Op(object): while True: batch = [] _LOGGER.debug( - log_func("Auto-batching expect size: {}; timeout: {}".format( + log_func("Auto-batching expect size: {}; timeout(s): {}".format( batch_size, timeout))) while len(batch) == 0: endtime = None -- GitLab