[GitHub] [airflow] ei-grad commented on a diff in pull request #23720: Fix backfill queued task getting reset to scheduled state.

2022-10-27 Thread GitBox


ei-grad commented on code in PR #23720:
URL: https://github.com/apache/airflow/pull/23720#discussion_r1006973733


##
airflow/executors/kubernetes_executor.py:
##
@@ -464,7 +464,9 @@ def clear_not_launched_queued_tasks(self, session=None) -> 
None:
 if not self.kube_client:
 raise AirflowException(NOT_STARTED_MESSAGE)
 
-query = session.query(TaskInstance).filter(TaskInstance.state == 
State.QUEUED)
+query = session.query(TaskInstance).filter(
+TaskInstance.state == State.QUEUED, TaskInstance.queued_by_job_id 
== self.job_id
+)

Review Comment:
   Would it be possible to have more than one backfill running then?



-- 
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-unsubscr...@airflow.apache.org

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



[GitHub] [airflow] ei-grad commented on a diff in pull request #23720: Fix backfill queued task getting reset to scheduled state.

2022-10-14 Thread GitBox


ei-grad commented on code in PR #23720:
URL: https://github.com/apache/airflow/pull/23720#discussion_r995982091


##
airflow/executors/kubernetes_executor.py:
##
@@ -464,7 +464,9 @@ def clear_not_launched_queued_tasks(self, session=None) -> 
None:
 if not self.kube_client:
 raise AirflowException(NOT_STARTED_MESSAGE)
 
-query = session.query(TaskInstance).filter(TaskInstance.state == 
State.QUEUED)
+query = session.query(TaskInstance).filter(
+TaskInstance.state == State.QUEUED, TaskInstance.queued_by_job_id 
== self.job_id
+)

Review Comment:
   > Can we have only this change plus the test on this PR?
   
   Wouldn't `self.job_id` have value `"backfill"` without the change in 
[airflow/jobs/backfill_job.py](https://github.com/apache/airflow/pull/23720/files#diff-ce6cb8661a9f4cb5453effb446e6fbccf42a61d597445fe98899051db61436db)?



-- 
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-unsubscr...@airflow.apache.org

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



[GitHub] [airflow] ei-grad commented on a diff in pull request #23720: Fix backfill queued task getting reset to scheduled state.

2022-10-14 Thread GitBox


ei-grad commented on code in PR #23720:
URL: https://github.com/apache/airflow/pull/23720#discussion_r995982091


##
airflow/executors/kubernetes_executor.py:
##
@@ -464,7 +464,9 @@ def clear_not_launched_queued_tasks(self, session=None) -> 
None:
 if not self.kube_client:
 raise AirflowException(NOT_STARTED_MESSAGE)
 
-query = session.query(TaskInstance).filter(TaskInstance.state == 
State.QUEUED)
+query = session.query(TaskInstance).filter(
+TaskInstance.state == State.QUEUED, TaskInstance.queued_by_job_id 
== self.job_id
+)

Review Comment:
   Wouldn't `self.job_id` have value `"backfill"` without the change in 
[airflow/jobs/backfill_job.py](https://github.com/apache/airflow/pull/23720/files#diff-ce6cb8661a9f4cb5453effb446e6fbccf42a61d597445fe98899051db61436db)?



-- 
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-unsubscr...@airflow.apache.org

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