Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Continuous timetable causes false dag triggering if dag has already run and start_date is in future #45081

Open
1 of 2 tasks
darkag opened this issue Dec 19, 2024 · 2 comments
Assignees
Labels
area:core area:Scheduler including HA (high availability) scheduler good first issue kind:bug This is a clearly a bug

Comments

@darkag
Copy link
Contributor

darkag commented Dec 19, 2024

Apache Airflow version

2.10.4

If "Other Airflow 2 version" selected, which one?

No response

What happened?

hello,
here is a sample dag

import pendulum 
import airflow
import logging
from airflow import DAG
from datetime import timedelta, datetime
from airflow.utils.dates import days_ago
from airflow.operators.python import PythonOperator
from airflow.decorators import task

local_tz = pendulum.timezone("Europe/Paris")

default_args = {
	'owner': 'interfaces',
	'depends_on_past': False,
	'retries': 0,
	'retry_delay': timedelta(minutes=1),
}
with DAG(
	dag_id='test_continous',
	default_args=default_args,
	schedule='@continuous',
	start_date=datetime(2024,12,19, 16, 40, tzinfo=local_tz),
    end_date= datetime(2024,12,19, 16, 46, tzinfo=local_tz),
	max_active_runs=1,
	catchup=False,
) as dag:
    
    @task()
    def the_task():
        import time
        time.sleep(25)

    the_task()

the first time you activate it, it will correctly wait for start_date to trigger dag run but if it has already run, every seconds it will trigger a "void" dag run (no task started just a row inserted in the dag_run table)

What you think should happen instead?

Dag shouldn't be triggered until the new start_date is passed

How to reproduce

use the given dag, change start_date and end_date in order to let dag runs for a few minutes. when end_date is passed change start_date and end_date in order to make dag runs in future.

Operating System

debian 11

Versions of Apache Airflow Providers

No response

Deployment

Official Apache Airflow Helm Chart

Deployment details

No response

Anything else?

No response

Are you willing to submit PR?

  • Yes I am willing to submit a PR!

Code of Conduct

@darkag darkag added area:core kind:bug This is a clearly a bug needs-triage label for new issues that we didn't triage yet labels Dec 19, 2024
@dosubot dosubot bot added the area:Scheduler including HA (high availability) scheduler label Dec 19, 2024
@potiuk potiuk added good first issue and removed needs-triage label for new issues that we didn't triage yet labels Dec 19, 2024
@jx2lee
Copy link
Contributor

jx2lee commented Dec 20, 2024

I would like to work on this. Could you assign it to me? Thanks. ☺️

@potiuk
Copy link
Member

potiuk commented Dec 20, 2024

I would like to work on this. Could you assign it to me? Thanks. ☺️

did

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:core area:Scheduler including HA (high availability) scheduler good first issue kind:bug This is a clearly a bug
Projects
None yet
Development

No branches or pull requests

3 participants