shai-ikko commented on issue #40841: URL: https://github.com/apache/airflow/issues/40841#issuecomment-2247433686
Hi @omkar-foss , thanks for this! Indeed, I've checked again, and the `start_date` on the DAG itself is updated -- so it does not represent "this is when this DAG came into being", but rather "start_date of last DAG run". And then, it being updated on the task to match the last task instance execution also makes sense. But then, I suspect the code in `prev_dagrun_dep.py` needs a different fix -- it should drop the assumption that `start_date` means "a date before which the task did not exist"; the problem with the test you fixed is not a race condition, but that it's checking the wrong thing. On a first guess, I'd think that the right thing to check is, as in the next check in the file -- ```python not self._has_tis(last_dagrun, ti.task_id, session=session) ``` but looking at that block makes me think that either I'm missing something, or that block is actually wrong too. https://github.com/omkar-foss/airflow/blob/2575b39e7876b19c1be93626e2247926327a1205/airflow/ti_deps/deps/prev_dagrun_dep.py#L169-L184 (but if the block is right, then I think the "check for first instance of task when there was a run of the dag" block should be folded into it) -- 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: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
