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 50B69200BD4 for ; Fri, 16 Dec 2016 16:27:08 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 4F480160B24; Fri, 16 Dec 2016 15:27: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 97469160AF6 for ; Fri, 16 Dec 2016 16:27:07 +0100 (CET) Received: (qmail 13631 invoked by uid 500); 16 Dec 2016 15:27: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 13622 invoked by uid 99); 16 Dec 2016 15:27:06 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd1-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Dec 2016 15:27:06 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd1-us-west.apache.org (ASF Mail Server at spamd1-us-west.apache.org) with ESMTP id 6C34EC7274 for ; Fri, 16 Dec 2016 15:27:06 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd1-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 (spamd1-us-west.apache.org [10.40.0.7]) (amavisd-new, port 10024) with ESMTP id LsQEwU1IAlCO for ; Fri, 16 Dec 2016 15:27: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 E1F3F5FB6B for ; Fri, 16 Dec 2016 15:27:04 +0000 (UTC) Received: (qmail 12928 invoked by uid 99); 16 Dec 2016 15:26:58 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 16 Dec 2016 15:26:58 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id B75F12C03E4 for ; Fri, 16 Dec 2016 15:26:58 +0000 (UTC) Date: Fri, 16 Dec 2016 15:26:58 +0000 (UTC) From: "Len Frodgers (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Updated] (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: Fri, 16 Dec 2016 15:27:08 -0000 [ https://issues.apache.org/jira/browse/AIRFLOW-703?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ] Len Frodgers updated AIRFLOW-703: --------------------------------- Attachment: xcom_bug_op2_logs.txt xcom_bug_op1_logs.txt task instance logs attached > 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 > 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. -- This message was sent by Atlassian JIRA (v6.3.4#6332)