提交 1de6854a 编写于 作者: B barriery

update code

上级 b27f43de
...@@ -330,8 +330,8 @@ class ProcessChannel(object): ...@@ -330,8 +330,8 @@ class ProcessChannel(object):
def front(self, op_name=None, timeout=None): def front(self, op_name=None, timeout=None):
_LOGGER.debug( _LOGGER.debug(
self._log("{} try to get data[?]; timeout={}".format(op_name, self._log("{} try to get data[?]; timeout(s)={}".format(op_name,
timeout))) timeout)))
endtime = None endtime = None
if timeout is not None: if timeout is not None:
if timeout <= 0: if timeout <= 0:
...@@ -603,8 +603,8 @@ class ThreadChannel(Queue.Queue): ...@@ -603,8 +603,8 @@ class ThreadChannel(Queue.Queue):
def front(self, op_name=None, timeout=None): def front(self, op_name=None, timeout=None):
_LOGGER.debug( _LOGGER.debug(
self._log("{} try to get data[?]; timeout={}".format(op_name, self._log("{} try to get data[?]; timeout(s)={}".format(op_name,
timeout))) timeout)))
endtime = None endtime = None
if timeout is not None: if timeout is not None:
if timeout <= 0: if timeout <= 0:
......
...@@ -87,8 +87,9 @@ class Op(object): ...@@ -87,8 +87,9 @@ class Op(object):
.format(self.name, self._batch_size)) .format(self.name, self._batch_size))
self._batch_size = 1 self._batch_size = 1
if self._auto_batching_timeout != None: if self._auto_batching_timeout != None:
_LOGGER.warn("Op({}) reset auto_batching_timeout=1 (original: {})" _LOGGER.warn(
.format(self.name, self._auto_batching_timeout)) "Op({}) reset auto_batching_timeout=None (original: {})"
.format(self.name, self._auto_batching_timeout))
self._auto_batching_timeout = None self._auto_batching_timeout = None
def use_profiler(self, use_profile): def use_profiler(self, use_profile):
...@@ -235,6 +236,9 @@ class Op(object): ...@@ -235,6 +236,9 @@ class Op(object):
target=self._run, target=self._run,
args=(concurrency_idx, self._get_input_channel(), args=(concurrency_idx, self._get_input_channel(),
self._get_output_channels(), client_type, True)) 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() t.start()
threads.append(t) threads.append(t)
return threads return threads
...@@ -310,7 +314,7 @@ class Op(object): ...@@ -310,7 +314,7 @@ class Op(object):
_LOGGER.error(error_info) _LOGGER.error(error_info)
else: else:
_LOGGER.warn( _LOGGER.warn(
log_func("timeout, retry({}/{})" log_func("PaddleService timeout, retry({}/{})"
.format(i + 1, self._retry))) .format(i + 1, self._retry)))
except Exception as e: except Exception as e:
ecode = ChannelDataEcode.UNKNOW.value ecode = ChannelDataEcode.UNKNOW.value
...@@ -399,7 +403,7 @@ class Op(object): ...@@ -399,7 +403,7 @@ class Op(object):
while True: while True:
batch = [] batch = []
_LOGGER.debug( _LOGGER.debug(
log_func("Auto-batching expect size: {}; timeout: {}".format( log_func("Auto-batching expect size: {}; timeout(s): {}".format(
batch_size, timeout))) batch_size, timeout)))
while len(batch) == 0: while len(batch) == 0:
endtime = None endtime = None
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册