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 83611200CF7 for ; Tue, 19 Sep 2017 16:53:06 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 8208E1609E0; Tue, 19 Sep 2017 14:53:06 +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 C80221609DB for ; Tue, 19 Sep 2017 16:53:05 +0200 (CEST) Received: (qmail 73643 invoked by uid 500); 19 Sep 2017 14:53:04 -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 73634 invoked by uid 99); 19 Sep 2017 14:53:04 -0000 Received: from pnap-us-west-generic-nat.apache.org (HELO spamd3-us-west.apache.org) (209.188.14.142) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Sep 2017 14:53:04 +0000 Received: from localhost (localhost [127.0.0.1]) by spamd3-us-west.apache.org (ASF Mail Server at spamd3-us-west.apache.org) with ESMTP id 79369184A11 for ; Tue, 19 Sep 2017 14:53:04 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -99.201 X-Spam-Level: X-Spam-Status: No, score=-99.201 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, RP_MATCHES_RCVD=-0.001, SPF_PASS=-0.001, URIBL_BLOCKED=0.001, USER_IN_WHITELIST=-100] autolearn=disabled Received: from mx1-lw-us.apache.org ([10.40.0.8]) by localhost (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id ophba7ubYNhk for ; Tue, 19 Sep 2017 14:53:03 +0000 (UTC) Received: from mailrelay1-us-west.apache.org (mailrelay1-us-west.apache.org [209.188.14.139]) by mx1-lw-us.apache.org (ASF Mail Server at mx1-lw-us.apache.org) with ESMTP id 6F9745FCF4 for ; Tue, 19 Sep 2017 14:53:03 +0000 (UTC) Received: from jira-lw-us.apache.org (unknown [207.244.88.139]) by mailrelay1-us-west.apache.org (ASF Mail Server at mailrelay1-us-west.apache.org) with ESMTP id 7E19AE0A29 for ; Tue, 19 Sep 2017 14:53:02 +0000 (UTC) Received: from jira-lw-us.apache.org (localhost [127.0.0.1]) by jira-lw-us.apache.org (ASF Mail Server at jira-lw-us.apache.org) with ESMTP id DD6382451E for ; Tue, 19 Sep 2017 14:53:00 +0000 (UTC) Date: Tue, 19 Sep 2017 14:53:00 +0000 (UTC) From: "Richard Penman (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Commented] (AIRFLOW-1623) Clearing task in UI does not trigger on_kill method in operator MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Tue, 19 Sep 2017 14:53:06 -0000 [ https://issues.apache.org/jira/browse/AIRFLOW-1623?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16171819#comment-16171819 ] Richard Penman commented on AIRFLOW-1623: ----------------------------------------- The obvious fix was suggested by Joy Gao on the mailing list to insert _self.task_instance.task.on_kill()_ here. This successfully triggers the operator on_kill() method, however the state of the operator instance is lost - a new instance is used here without variables set in the _execute()_ method. For example the [BashOperator|https://github.com/apache/incubator-airflow/blob/master/airflow/operators/bash_operator.py#L89] stores a reference to the process in _self.sp_ and so calling _on_kill()_ on a new instance would raise an _AttributeError_. > Clearing task in UI does not trigger on_kill method in operator > --------------------------------------------------------------- > > Key: AIRFLOW-1623 > URL: https://issues.apache.org/jira/browse/AIRFLOW-1623 > Project: Apache Airflow > Issue Type: Bug > Components: operators > Affects Versions: Airflow 2.0 > Reporter: Richard Penman > Priority: Minor > Fix For: Airflow 2.0 > > > When a task is cleared in the UI it doesn't call the [operators on_kill() method|https://github.com/apache/incubator-airflow/blob/b2e1753f5b74ad1b6e0889f7b784ce69623c95ce/airflow/models.py#L2380] to clean up the task. Apparently this is meant to be handled in the [LocalTaskJob.on_kill()|https://github.com/apache/incubator-airflow/blob/b2e1753f5b74ad1b6e0889f7b784ce69623c95ce/airflow/jobs.py#L2512] method, however it is not currently. -- This message was sent by Atlassian JIRA (v6.4.14#64029)