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 2020/02/22 22:25:14 UTC

[GitHub] [airflow] kaxil commented on a change in pull request #7507: [AIRFLOW-6885] Delete worker on success

kaxil commented on a change in pull request #7507: [AIRFLOW-6885] Delete worker on success
URL: https://github.com/apache/airflow/pull/7507#discussion_r382946207
 
 

 ##########
 File path: airflow/executors/kubernetes_executor.py
 ##########
 @@ -848,10 +850,13 @@ def sync(self) -> None:
 
     def _change_state(self, key: TaskInstanceKeyType, state: Optional[str], pod_id: str) -> None:
         if state != State.RUNNING:
-            if self.kube_config.delete_worker_pods:
+            if self.kube_config.delete_on_success and state is State.SUCCESS:
                 if not self.kube_scheduler:
                     raise AirflowException(NOT_STARTED_MESSAGE)
                 self.kube_scheduler.delete_pod(pod_id)
+            elif self.kube_config.delete_worker_pods:
+                if not self.kube_scheduler:
+                    raise AirflowException(NOT_STARTED_MESSAGE)
 
 Review comment:
   Yup it is

----------------------------------------------------------------
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.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


With regards,
Apache Git Services