Giter Club home page Giter Club logo

Comments (2)

woodlee avatar woodlee commented on July 23, 2024

I'll attempt a self-answer based on some experimentation I've been doing, but please tell me I'm wrong if you know otherwise:

The various scheduled instances of a task X are always attempted serially; at the moment, no setting is available to change this. depends_on_past sounds like it might do it, but that setting only controls whether a later instance of the task can be scheduled if the prior one has been attempted but failed, not whether the task's instances can be run in parallel.

As such, my initial question doesn't make sense. Only one instance of a task will be scheduled to run at a time, and from there it's simply a matter of whether the sensor triggers or not. This does mean, though, that if you have a sensor that never triggers for some reason, your schedule will be totally blocked by that. So that may mean that airflow isn't really designed for passively waiting for something to happen so much as it is for actively checking for things to do on a schedule.

As a design consideration: if an early task in a DAG is able to determine that there's nothing to do when its schedule rolls around, it would be nice to be able to quickly mark the rest of that scheduled DAG as complete when it makes sense to do so. Perhaps this could be signaled by a "skipped" status, along with mechanisms for allowing downstream tasks to determine their own behavior based on the completion statuses of their upstreams. Food for future thought, unless that's something you guys have already considered and discarded, in which case I'd love to hear more about why.

from airflow.

mistercrunch avatar mistercrunch commented on July 23, 2024

You're right, as it is now the scheduler won't parallelize or fill in holes. Note that airflow backfill does though. The way the scheduler operates is documented here:

http://pythonhosted.org/airflow/scheduler.html

depends_on_past keeps from scheduling forward after a failure. And forces sequential execution for backfills (who do parallelize not depends_on_past tasks).

Adding a skipped or upstream_failed status as you suggested would allow for non depends_on_past tasks to move forward without changing the current scheduler logic much. I haven't done it yet because I may want this status to be virtual, but it requires more complexity in the scheduler and could affect the scheduler's weight on the metadata database and cycling time. We like for the scheduler to run every minute, even with 10k+ tasks which could grow 10x over the next few years.

The upstream_failed status is probably the way to go, though since the scheduler never moves back to fill in holes, it would require running backfill commands to fill in holes left behind. Maybe once we have a UI wizard to do that it won't matter much.

I also may want to trigger the current latest schedule regardless of what the DAG is up to, that brings back the problem around filling holes.

from airflow.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.