Skip to content

Commit ffedc95

Browse files
author
Liyan Jiang
committed
Changed logger level
1 parent 207773e commit ffedc95

File tree

1 file changed

+11
-6
lines changed

1 file changed

+11
-6
lines changed

prefect_aws/ecs.py

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -273,8 +273,8 @@ class ECSTask(Infrastructure):
273273
task_start_timeout_seconds: The amount of time to watch for the
274274
start of the ECS task before marking it as failed. The task must
275275
enter a RUNNING state to be considered started.
276-
task_finish_timeout_seconds: The amount of time to watch for finishing of the ECS task
277-
before marking it as failed.
276+
task_finish_timeout_seconds: The amount of time to watch for finishing of the
277+
ECS task before marking it as failed.
278278
task_watch_poll_interval: The amount of time to wait between AWS API
279279
calls while monitoring the state of an ECS task.
280280
"""
@@ -900,7 +900,7 @@ def _create_task_and_wait_for_start(
900900
task_arn = task["taskArn"]
901901
cluster_arn = task["clusterArn"]
902902
except Exception as exc:
903-
self.logger.info(f"EcsTaskException: {exc}")
903+
self.logger.error(f"EcsTaskException: {exc}")
904904
self._report_task_run_creation_failure(task_run, exc)
905905

906906
# Raises an exception if the task does not start
@@ -1129,7 +1129,7 @@ def _watch_task_run(
11291129
else:
11301130
# Intermittently, the task will not be described. We wat to respect the
11311131
# watch timeout though.
1132-
self.logger.debug(f"{self._log_prefix}: Task not found.")
1132+
self.logger.warning(f"{self._log_prefix}: Task not found.")
11331133

11341134
elapsed_time = time.time() - t0
11351135
if timeout is not None and elapsed_time > timeout:
@@ -1159,12 +1159,17 @@ def _wait_for_task_start(
11591159
reason = task.get("stoppedReason")
11601160

11611161
containers = task["containers"]
1162-
exit_codes = " ".join([container.get("exitCode", "?exitCode?") for container in containers])
1162+
exit_codes = " ".join(
1163+
[
1164+
container.get("exitCode", "?exitCode?")
1165+
for container in containers
1166+
]
1167+
)
11631168
try:
11641169
# Generate a dynamic exception type from the AWS name
11651170
raise type(code, (RuntimeError,), {})(f"{reason=} {exit_codes=}")
11661171
except Exception as exc:
1167-
self.logger.info(f"EcsTaskException: {exc}")
1172+
self.logger.error(f"EcsTaskException: {exc}")
11681173
raise
11691174

11701175
return task

0 commit comments

Comments
 (0)