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 43739200BE4 for ; Wed, 21 Dec 2016 16:52:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4228D160B26; Wed, 21 Dec 2016 15:52:08 +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 89D5D160B18 for ; Wed, 21 Dec 2016 16:52:07 +0100 (CET) Received: (qmail 98660 invoked by uid 500); 21 Dec 2016 15:52:06 -0000 Mailing-List: contact commits-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 commits@airflow.incubator.apache.org Received: (qmail 98651 invoked by uid 99); 21 Dec 2016 15:52:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd4-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2016 15:52:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd4-us-west.apache.org (ASF Mail Server at spamd4-us-west.apache.org) with ESMTP id 4F9A7C033A for ; Wed, 21 Dec 2016 15:52:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd4-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -7.019 X-Spam-Level: X-Spam-Status: No, score=-7.019 tagged_above=-999 required=6.31 tests=[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=-2.999] autolearn=disabled Received: from mx1-lw-eu.apache.org ([10.40.0.8]) by localhost (spamd4-us-west.apache.org [10.40.0.11]) (amavisd-new, port 10024) with ESMTP id 0aWQOTa1eKsb for ; Wed, 21 Dec 2016 15:52:05 +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 B69855FB69 for ; Wed, 21 Dec 2016 15:51:59 +0000 (UTC) Received: (qmail 97009 invoked by uid 99); 21 Dec 2016 15:51:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 21 Dec 2016 15:51:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 7D51F2C1F56 for ; Wed, 21 Dec 2016 15:51:58 +0000 (UTC) Date: Wed, 21 Dec 2016 15:51:58 +0000 (UTC) From: "Jeremiah Lowin (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Assigned] (AIRFLOW-703) Xcom data cleared too soon MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 21 Dec 2016 15:52:08 -0000 [ https://issues.apache.org/jira/browse/AIRFLOW-703?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Jeremiah Lowin reassigned AIRFLOW-703: -------------------------------------- Assignee: Jeremiah Lowin > Xcom data cleared too soon > -------------------------- > > Key: AIRFLOW-703 > URL: https://issues.apache.org/jira/browse/AIRFLOW-703 > Project: Apache Airflow > Issue Type: Bug > Components: core, scheduler, xcom > Affects Versions: Airflow 2.0, Airflow 1.7.1.3 > Environment: Tested using Dockerized Airflow setup with MySQL backend and Celery executor > Reporter: Len Frodgers > Assignee: Jeremiah Lowin > Labels: xcom > Attachments: xcom_bug.py, xcom_bug_op1_logs.txt, xcom_bug_op2_logs.txt > > > Xcom data is cleared at the start of the `run` method of the `TaskInstance`, regardless of whether the TI is subsequently executed (e.g. if the TI has previously succeeded, it won't execute). This means that if a TI for a DagRun is run twice in close succession, the latter will correctly not execute (since the former TI succeeded or is still running), but WILL clear any xcoms set by the former TI. Therefore, any downstream tasks depending on these xcoms will fail. > I noticed this bug when I changed num_runs of the scheduler from None to 10. It didn't happen every time, but probably 50% or so. > However, I can reproduce this reliably and repeatably with the following test dag: > [attached] > To make op1 execute twice, I use the UI to run it twice while op2 is doing the `time.sleep`. > Logs from running this: > [attached] > The fix seems straightforward: don't clear xcom unless the TI will actually execute. Will happily create a PR. > The suspect line is here: https://github.com/apache/incubator-airflow/blob/master/airflow/models.py#L1202 -- This message was sent by Atlassian JIRA (v6.3.4#6332)