akotlar opened a new issue #13198:
URL: https://github.com/apache/airflow/issues/13198


   **Apache Airflow version**: 2.0.0
   
   **Environment**:
   
   - **Cloud provider or hardware configuration**:
   - **OS** (e.g. from /etc/os-release): Ubuntu 18.04
   - **Kernel** (e.g. `uname -a`): Linux workstation38 5.4.0-52-generic 
#57~18.04.1-Ubuntu SMP Thu Oct 15 14:04:49 UTC 2020 x86_64 x86_64 x86_64 
GNU/Linux
   
   **What happened**:
   
   Ran a dag, could not trigger a subsequent run.
   
   Dag settings:
   
   ```
   with DAG(dag_id=DAG_NAME,
            default_args=default_args,
            schedule_interval='@daily',
            max_active_runs=1,
            catchup=False,
            tags=['tag'],
            is_paused_upon_creation=True) as dag:
   ```
   
   Dag ran, and was marked as successful. Triggering a 2nd run (manually) 
failed to schedule any tasks, with the message in scheduler logs:
   
   [2020-12-20 16:05:50,919] {scheduler_job.py:1667} INFO - DAG <dag_name> 
already has 1 active runs, not queuing any tasks for run 2020-12-20 
20:52:38.216778+00:00
   
   To complicate things: during the execution of the dag, I modified the name 
of one of the tasks, and this was done, I believe, after that task had finished 
processing. This resulted in further UI / log location issues described below.
   
   **What you expected to happen**:
   
   The manually triggered DAG should have resulted in tasks being scheduled.
   
   <!-- What do you think went wrong? -->
   
   The DAG was somehow not entirely marked as successful, hitting 
max_active_runs limits. 
   
   The fact that I had changed the name of a task inside of a task group, 
before the dag finished, may have screwed up the check.  Interestingly, the UI 
showed the first dag run as completed.
   
   **How to reproduce it**:
   
   ```
   with DAG(dag_id=DAG_NAME,
            default_args=default_args,
            schedule_interval='@daily',
            max_active_runs=1,
            catchup=False,
            tags=['tag'],
            is_paused_upon_creation=True) as dag:
       t1= task(function_one)
       t2= task(function_two)
       t3= task(function_three) # say I change the function name to 
function_three_2, the clobbering issue will be triggered
       t4= task(function_four)
   
       start = DummyOperator(task_id="start")
       end = DummyOperator(task_id="end")
       for abs_pivat_run_path in folders_list:
           basename = os.path.basename(abs_pivat_run_path)
      
           with TaskGroup(basename, tooltip=f"Tasks for {basename}") as 
task_group:
               t1(path) >> t2() >> t3(abs_pivat_run_path) >> 
t4(abs_pivat_run_path)
   
           start >> task_group >> end
   
   ```
   
   There also appear to be a UI issue. The tasks whose names changed (for 
already completed tasks but for a DAG run that is still in progress) are 
updated to reflect the new names in the UI, and take the state of the 
already-completed tasks (which had a different name), but the log location is 
that using the new name, rather than the old. I think this happens because 
somehow the task id of a task instance is being clobbered.
   
   How often does this problem occur? Once? Every time etc?
   
   Every time


----------------------------------------------------------------
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:
[email protected]


Reply via email to