Commit 029625dd authored by Philip ABBET's avatar Philip ABBET

Docker executor: better handling of the log produced inside the container

parent 82deb935
......@@ -417,9 +417,18 @@ class DockerExecutor(BaseExecutor):
# Collects final information and returns to caller
container_log = self.host.stderr(algorithm_container)
stderr = ''
if status != 0:
stderr = container_log
if logger.getEffectiveLevel() <= logging.DEBUG:
logger.debug("Log of the container: " + container_log)
retval = dict(
stdout = self.host.stdout(algorithm_container),
stderr = self.host.stderr(algorithm_container),
stderr = stderr,
status = status,
timed_out = timed_out,
statistics = self.host.statistics(algorithm_container),
......@@ -434,7 +443,8 @@ class DockerExecutor(BaseExecutor):
if databases_container is not None:
retval['stdout'] += '\n' + self.host.stdout(databases_container)
retval['stderr'] += '\n' + self.host.stderr(databases_container)
if status != 0:
retval['stderr'] += '\n' + self.host.stderr(databases_container)
self.host.rm(databases_container)
self.db_socket.setsockopt(zmq.LINGER, 0)
self.db_socket.close()
......
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