Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 4F970200B49 for ; Wed, 3 Aug 2016 08:37:07 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 4E49C160A86; Wed, 3 Aug 2016 06:37:07 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 917AF160A64 for ; Wed, 3 Aug 2016 08:37:06 +0200 (CEST) Received: (qmail 54198 invoked by uid 500); 3 Aug 2016 06:37:05 -0000 Mailing-List: contact dev-help@airflow.incubator.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@airflow.incubator.apache.org Delivered-To: mailing list dev@airflow.incubator.apache.org Received: (qmail 54187 invoked by uid 99); 3 Aug 2016 06:37:05 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd2-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Aug 2016 06:37:05 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd2-us-west.apache.org (ASF Mail Server at spamd2-us-west.apache.org) with ESMTP id 4C3531A0099 for ; Wed, 3 Aug 2016 06:37:05 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd2-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -3.446 X-Spam-Level: X-Spam-Status: No, score=-3.446 tagged_above=-999 required=6.31 tests=[HTML_MESSAGE=2, KAM_LAZY_DOMAIN_SECURITY=1, RCVD_IN_DNSWL_HI=-5, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RP_MATCHES_RCVD=-1.426] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd2-us-west.apache.org [10.40.0.9]) (amavisd-new, port 10024) with ESMTP id GT9Jbqn6TILg for ; Wed, 3 Aug 2016 06:37:04 +0000 (UTC) Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx1-lw-eu.apache.org (ASF Mail Server at mx1-lw-eu.apache.org) with SMTP id 2F7695F248 for ; Wed, 3 Aug 2016 06:37:03 +0000 (UTC) Received: (qmail 54170 invoked by uid 99); 3 Aug 2016 06:37:02 -0000 Received: from mail-relay.apache.org (HELO mail-relay.apache.org) (140.211.11.15) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 03 Aug 2016 06:37:02 +0000 Received: from mail-oi0-f41.google.com (mail-oi0-f41.google.com [209.85.218.41]) by mail-relay.apache.org (ASF Mail Server at mail-relay.apache.org) with ESMTPSA id 2DBED1A0250 for ; Wed, 3 Aug 2016 06:37:02 +0000 (UTC) Received: by mail-oi0-f41.google.com with SMTP id j185so267519408oih.0 for ; Tue, 02 Aug 2016 23:37:02 -0700 (PDT) X-Gm-Message-State: AEkoout+5O1HR3J1CnzCIjGT6msRkBeRd40MydDh4Lt/uTsoIiVXPUHcufUQrch521Y+4+BNmdAgskutOMj8mQ== X-Received: by 10.157.39.98 with SMTP id r89mr4441193ota.102.1470206221454; Tue, 02 Aug 2016 23:37:01 -0700 (PDT) MIME-Version: 1.0 Received: by 10.202.55.132 with HTTP; Tue, 2 Aug 2016 23:37:00 -0700 (PDT) In-Reply-To: References: From: siddharth anand Date: Tue, 2 Aug 2016 23:37:00 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: Handling running tasks To: dev@airflow.incubator.apache.org Content-Type: multipart/alternative; boundary=001a113ce6c29393d40539250f60 archived-at: Wed, 03 Aug 2016 06:37:07 -0000 --001a113ce6c29393d40539250f60 Content-Type: text/plain; charset=UTF-8 +1 on the uniqueness of the solution. Wondering how it worked! -s On Sun, Jul 10, 2016 at 9:02 AM, Cyril Scetbon wrote: > Interesting. Thanks for this solution Lance, gonna try it > > On Jul 6, 2016, at 19:11, Lance Norskog wrote: > > > > You could use the XCOM feature to post a semaphore at the start of the > task > > and then remove it at the end. > > Another task would see the semaphore and immediately quit. > > If you get a race condition, the third 15-minute task will take care of > the > > problem, 15 minutes late. > > > > Lance > > > > On Wed, Jul 6, 2016 at 2:50 PM, Cyril Scetbon > wrote: > > > >> Hi, > >> > >> I have dags with tasks that use same configuration and same schedule > time > >> frequencies. > >> > >> When I have x tasks in a dag they run in //. My dag is scheduled every > 15 > >> minutes, but sometimes I have at least a task that runs for more than 15 > >> minutes and 2 identical tasks should not run at the same time (in my > case) > >> but it's what happens. > >> > >> So when the dag is kicked off (every 15 min) I need Airflow to run tasks > >> only for those that are not running, which means : > >> > >> - if at time t1 tasks tk1 is running and tk2, ..., tkn are not running, > I > >> need Airflow to run only tk2,.., tkn but not tk1 cause it's already > running > >> - if at time t2 tasks tk1, ..., tkn are not running, I need Airflow to > run > >> tk1,.., tkn > >> > >> I already tried using depends_on_past=True, however I need failed tasks > to > >> be kicked off, cause I can get some temporary issues. > >> > >> I also use an upstream task connected to all tasks in my dag to be able > to > >> run manually all tasks if I need to. (I don't use a frequency of 15 > minutes > >> in all dags) > >> > >> Any idea ? > > > > > > > > > > -- > > Lance Norskog > > lance.norskog@gmail.com > > Redwood City, CA > > --001a113ce6c29393d40539250f60--