This is an automated email from the ASF dual-hosted git repository.

dstandish pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/airflow.git


The following commit(s) were added to refs/heads/main by this push:
     new afe8e82531 Don't wait for DagRun lock in mini scheduler (#38914)
afe8e82531 is described below

commit afe8e82531cece4f3aeaea465b985ebd7257e71d
Author: Daniel Standish <15932138+dstand...@users.noreply.github.com>
AuthorDate: Wed Apr 10 20:06:37 2024 -0700

    Don't wait for DagRun lock in mini scheduler (#38914)
    
    We should just bail if something else is already "minischeduling".  We 
already catch OperationalError so there's nothing else we need to change for 
this.
    
    Sometimes (e.g. with certain task mapping scenarios) many tasks from same 
dag run are trying to "minischedule" at the same time.  If something else is 
already locking, it's probably better to just move on and not wait.
---
 airflow/models/taskinstance.py | 1 +
 1 file changed, 1 insertion(+)

diff --git a/airflow/models/taskinstance.py b/airflow/models/taskinstance.py
index a55ea0fe77..c3bf25e343 100644
--- a/airflow/models/taskinstance.py
+++ b/airflow/models/taskinstance.py
@@ -3492,6 +3492,7 @@ class TaskInstance(Base, LoggingMixin):
                     run_id=ti.run_id,
                 ),
                 session=session,
+                nowait=True,
             ).one()
 
             task = ti.task

Reply via email to