airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Tree View Stopped Showing Colored Squares for one of my DAGs

Open r39132 opened this issue 11 years ago • 11 comments

screenshot 2015-07-14 17 38 18 Tree View stopped working for one of my DAGs. All I see in the Tree View are empty, uncolored squares. The job is itself running fine for the past 5 days, running every day. The Graph View, the Landing Times, Gantt, and Task Durations all show trends for the past 5 days. Unfortunately, the tree view shows uncolored squares. All of the squares are blank.

I'm running v 1.2 installed via PIP. I should mention that other dags are fine.

Also, my dag is using the new branch operator in 2 places and has about 10 nodes now in it. I don't expect this to be the reason for the Tree View to stop showing data.

r39132 avatar Jul 15 '15 00:07 r39132

Quick thought, did you change your start_date for something that isn't "square" at any point in time? By square I mean 00:00 for a daily job.

mistercrunch avatar Jul 15 '15 01:07 mistercrunch

Hmn... I see the start_date is set to datetime.now() .... Hmn...

default_args = {
    'owner': 'airflow',
    'depends_on_past': False,
    'start_date': datetime(2015, 7, 8),
    'email': ['[email protected]'],
    'email_on_failure': True,
    'email_on_retry': True,
    'retries': 3,
    'retry_interval': timedelta(seconds=5)
}
dag = DAG('ep_demo', start_date=datetime.now(), default_args=default_args)

r39132 avatar Jul 15 '15 01:07 r39132

Ok, so I'll change the datetime.now() to be rounded to 00:00. I haven't changed this part of the code in a long time, so I am guessing the handling of this changed in the past month or so with respect to the tree view.

r39132 avatar Jul 15 '15 01:07 r39132

@mistercrunch : Is the best way to have have a daily job trigger at a certain time then to use a start_date with 00:00 time, schedule_interval=timedelta(days=1) and make all task in a dag depend on an airflow.operators.TimeSensor? How is the use of sensors affected by the "parallelism" limit of the executor? Can you risk the execution queue being blocked by sensors just waiting for events?

storpipfugl avatar Jul 15 '15 09:07 storpipfugl

@storpipfugl: yes, and the docs should be more explicit about this

Sensors do take up a slot in your executor while they are running (sensing). You need to make sure you have plenty of slots available to support the max number of tasks that could ever run at the same time.

Sensors are typically cheap in terms of CPU / memory, so you can take that into account when factoring how many slots each worker should have.

mistercrunch avatar Jul 15 '15 16:07 mistercrunch

Confirmed this resolved my issue. Closing.

r39132 avatar Jul 16 '15 22:07 r39132

Sorry to hijack an already closed issue, but how would you go about doing this for an hourly job?

Unless TimeSensor can sense for dynamic times (x:10 every hour), how would you cause Airflow to sense that 5 minutes have passed?

pharoson avatar Aug 06 '15 16:08 pharoson

I think we need a TimeDeltaSensor that senses for a delta after execution_date. It should be very easy to write. Let me give it a shot.

mistercrunch avatar Aug 07 '15 06:08 mistercrunch

It's in: https://github.com/airbnb/airflow/pull/237

mistercrunch avatar Aug 07 '15 06:08 mistercrunch

Thank you. It works like a charm.

pharoson avatar Aug 07 '15 14:08 pharoson

Slight changes to the operator: https://github.com/airbnb/airflow/pull/239

mistercrunch avatar Aug 08 '15 00:08 mistercrunch