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 2022/10/11 06:16:26 UTC

[GitHub] [airflow] hterik commented on a diff in pull request #22976: Make sure jobs triggered by airflow web are not identified as orphaned.

hterik commented on code in PR #22976:
URL: https://github.com/apache/airflow/pull/22976#discussion_r991854664


##########
airflow/executors/kubernetes_executor.py:
##########
@@ -700,9 +700,14 @@ def _change_state(self, key: TaskInstanceKey, state: Optional[str], pod_id: str,
         self.event_buffer[key] = state, None
 
     def try_adopt_task_instances(self, tis: Sequence[TaskInstance]) -> Sequence[TaskInstance]:
-        tis_to_flush = [ti for ti in tis if not ti.queued_by_job_id]
-        scheduler_job_ids = {ti.queued_by_job_id for ti in tis}
-        pod_ids = {ti.key: ti for ti in tis if ti.queued_by_job_id}
+        scheduler_job_ids = {ti.queued_by_job_id for ti in tis if ti.queued_by_job_id}
+
+        # Tasks triggered through API will have no ti.queued_by_job_id
+        # and their pod will have label 'airflow-worker=manual'

Review Comment:
   Are you sure about this? We us the REST API a lot to trigger dags and I've never seen any pod with `airflow-worker=manual`. Do you have any pointers to where the _manual_ value is created.



-- 
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