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 C830C200B27 for ; Wed, 8 Jun 2016 06:23:26 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id C6DD9160A36; Wed, 8 Jun 2016 04:23:26 +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 1B285160A4F for ; Wed, 8 Jun 2016 06:23:25 +0200 (CEST) Received: (qmail 14726 invoked by uid 500); 8 Jun 2016 04:23:25 -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 14717 invoked by uid 99); 8 Jun 2016 04:23:25 -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; Wed, 08 Jun 2016 04:23:25 +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 C7C9B180603 for ; Wed, 8 Jun 2016 04:23:24 +0000 (UTC) X-Virus-Scanned: Debian amavisd-new at spamd3-us-west.apache.org X-Spam-Flag: NO X-Spam-Score: -4.646 X-Spam-Level: X-Spam-Status: No, score=-4.646 tagged_above=-999 required=6.31 tests=[KAM_ASCII_DIVIDERS=0.8, 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 (spamd3-us-west.apache.org [10.40.0.10]) (amavisd-new, port 10024) with ESMTP id KJ8Y5me7SGY5 for ; Wed, 8 Jun 2016 04:23:23 +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 B036D5FAF2 for ; Wed, 8 Jun 2016 04:23:22 +0000 (UTC) Received: (qmail 12891 invoked by uid 99); 8 Jun 2016 04:23:21 -0000 Received: from arcas.apache.org (HELO arcas) (140.211.11.28) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 08 Jun 2016 04:23:21 +0000 Received: from arcas.apache.org (localhost [127.0.0.1]) by arcas (Postfix) with ESMTP id 562A22C1F68 for ; Wed, 8 Jun 2016 04:23:21 +0000 (UTC) Date: Wed, 8 Jun 2016 04:23:21 +0000 (UTC) From: "Shenghu Yang (JIRA)" To: commits@airflow.incubator.apache.org Message-ID: In-Reply-To: References: Subject: [jira] [Comment Edited] (AIRFLOW-111) DAG concurrency is not honored MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 archived-at: Wed, 08 Jun 2016 04:23:27 -0000 [ https://issues.apache.org/jira/browse/AIRFLOW-111?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15319568#comment-15319568 ] Shenghu Yang edited comment on AIRFLOW-111 at 6/8/16 4:23 AM: -------------------------------------------------------------- I think the bug is here: https://github.com/apache/incubator-airflow/blob/18009d03311a0b29e14811865e0b13b19427b5e4/airflow/models.py#L1233-L1247 Let's see one task is already been 'QUEUED', and next time when we hit the above code, it will NOT check the 'self.task.dag.concurrency_reached', hence it will run the task beyond dag's concurrency. One fix would be right after the above code, we add the following: ######################## if self.task.dag.concurrency_reached: logging.warning('####dag {} concurrency {} reached'.format(self.job_id, self.task.dag.concurrency)) return else: logging.warning('####dag {} concurrency {} NOT reached'.format(self.job_id, self.task.dag.concurrency)) ######################## was (Author: shenghu): I think the bug is here: https://github.com/apache/incubator-airflow/blob/18009d03311a0b29e14811865e0b13b19427b5e4/airflow/models.py#L1233-L1247 Let's see one task is already been 'QUEUED', and next time when we hit the above code, it will NOT check the 'self.task.dag.concurrency_reached', hence it will run the task beyond dag's concurrency. One fix would be right after the above code, we add the following: ######################## if self.task.dag.concurrency_reached: logging.warning('####dag {} concurrency {} reached'.format(self.job_id, self.task.dag.concurrency)) return else: logging.warning('####dag {} concurrency {} NOT reached'.format(self.job_id, self.task.dag.concurrency)) ######################## > DAG concurrency is not honored > ------------------------------ > > Key: AIRFLOW-111 > URL: https://issues.apache.org/jira/browse/AIRFLOW-111 > Project: Apache Airflow > Issue Type: Sub-task > Components: celery, scheduler > Affects Versions: Airflow 1.6.2, Airflow 1.7.1.2 > Environment: Version of Airflow: 1.6.2 > Airflow configuration: Running a Scheduler with LocalExecutor > Operating System: 3.13.0-74-generic #118-Ubuntu SMP Thu Dec 17 22:52:10 UTC 2015 x86_64 x86_64 x86_64 GNU/Linux > Python Version: 2.7.6 > Screen shots of your DAG's status: > Reporter: Shenghu Yang > Fix For: Airflow 2.0 > > > Description of Issue > In our dag, we set the dag_args['concurrency'] = 8, however, when the scheduler starts to run, we can see this concurrency is not being honored, airflow scheduler will run up to num of the 'parallelism' (we set as 25) jobs. > What did you expect to happen? > dag_args['concurrency'] = 8 is honored, e.g. only run at most 8 jobs concurrently. > What happened instead? > when the dag starts to run, we can see the concurrency is not being honored, airflow scheduler/celery worker will run up to the 'parallelism' (we set as 25) jobs. > Here is how you can reproduce this issue on your machine: > create a dag which contains nothing but 25 parallelized jobs. > set the dag dag_args['concurrency'] = 8 > set the airflow parallelism to 25 > then run: airflow scheduler > you will see all 25 jobs are scheduled to run, not 8. -- This message was sent by Atlassian JIRA (v6.3.4#6332)