Skip to content

Commit 4cfc287

Browse files
small fix
1 parent 1aeb222 commit 4cfc287

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

  • components/job-orchestration/job_orchestration/executor/query

components/job-orchestration/job_orchestration/executor/query/utils.py

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -89,13 +89,6 @@ def sigterm_handler(_signo, _stack_frame):
8989
stdout_data, _ = task_proc.communicate()
9090
return_code = task_proc.returncode
9191

92-
# Dump the stderr log so it's visible in container logs
93-
if clo_log_path.stat().st_size > 0:
94-
logger.error(
95-
f"Contents of {clo_log_path.name}:\n"
96-
f"{clo_log_path.read_text()}"
97-
)
98-
9992
if 0 != return_code:
10093
task_status = QueryTaskStatus.FAILED
10194
logger.error(
@@ -106,6 +99,12 @@ def sigterm_handler(_signo, _stack_frame):
10699
logger.info(f"{task_name} task {task_id} completed for job {job_id}")
107100

108101
clo_log_file.close()
102+
# Dump the stderr log so it's visible in container logs
103+
if clo_log_path.stat().st_size > 0:
104+
logger.error(
105+
f"Contents of {clo_log_path.name}:\n"
106+
f"{clo_log_path.read_text()}"
107+
)
109108
duration = (datetime.datetime.now() - start_time).total_seconds()
110109

111110
update_query_task_metadata(

0 commit comments

Comments
 (0)