You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/11/02 22:42:25 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #19359: Task should fail immediately when pod is unprocessable

kaxil commented on a change in pull request #19359:
URL: https://github.com/apache/airflow/pull/19359#discussion_r741511783



##########
File path: airflow/executors/kubernetes_executor.py
##########
@@ -599,13 +599,14 @@ def sync(self) -> None:
                 try:
                     self.kube_scheduler.run_next(task)
                 except ApiException as e:
-                    if e.reason == "BadRequest":
-                        self.log.error("Request was invalid. Failing task")
+                    if e.reason in ("BadRequest", "Unprocessable Entity"):
+                        self.log.error(f"Pod creation failed with reason {e.reason!r}. Failing task")

Review comment:
       ```suggestion
                       if e.reason in ("BadRequest", "Unprocessable Entity"):
                           self.log.error("Pod creation failed with reason %r. Failing task", e.reason)
   ```
   ```suggestion
                       if e.reason in ("BadRequest", "Unprocessable Entity"):
                           self.log.error(f"Pod creation failed with reason {e.reason!r}. Failing task")
   ```




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@airflow.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org