You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/08/04 16:58:00 UTC

[jira] [Commented] (AIRFLOW-661) Celery Task Result Expiry

    [ https://issues.apache.org/jira/browse/AIRFLOW-661?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16569238#comment-16569238 ] 

ASF GitHub Bot commented on AIRFLOW-661:
----------------------------------------

ashb closed pull request #2143: [AIRFLOW-661] Add Celery broker_transport_options config
URL: https://github.com/apache/incubator-airflow/pull/2143
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/airflow/configuration.py b/airflow/configuration.py
index cfccbe9a25..47106e7347 100644
--- a/airflow/configuration.py
+++ b/airflow/configuration.py
@@ -319,6 +319,10 @@ def run_command(command):
 # information.
 broker_url = sqla+mysql://airflow:airflow@localhost:3306/airflow
 
+# Celery broker transport options. Provide options in JSON format. Refer to
+# the Celery documentation for more information.
+broker_transport_options = {{}}
+
 # Another key Celery setting
 celery_result_backend = db+mysql://airflow:airflow@localhost:3306/airflow
 
diff --git a/airflow/executors/celery_executor.py b/airflow/executors/celery_executor.py
index 04414fbc08..a7d7114711 100644
--- a/airflow/executors/celery_executor.py
+++ b/airflow/executors/celery_executor.py
@@ -16,6 +16,7 @@
 import logging
 import subprocess
 import time
+import json
 
 from celery import Celery
 from celery import states as celery_states
@@ -39,6 +40,7 @@ class CeleryConfig(object):
     CELERYD_PREFETCH_MULTIPLIER = 1
     CELERY_ACKS_LATE = True
     BROKER_URL = configuration.get('celery', 'BROKER_URL')
+    BROKER_TRANSPORT_OPTIONS = json.loads(configuration.get('celery', 'BROKER_TRANSPORT_OPTIONS'))
     CELERY_RESULT_BACKEND = configuration.get('celery', 'CELERY_RESULT_BACKEND')
     CELERYD_CONCURRENCY = configuration.getint('celery', 'CELERYD_CONCURRENCY')
     CELERY_DEFAULT_QUEUE = DEFAULT_QUEUE


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> Celery Task Result Expiry
> -------------------------
>
>                 Key: AIRFLOW-661
>                 URL: https://issues.apache.org/jira/browse/AIRFLOW-661
>             Project: Apache Airflow
>          Issue Type: Improvement
>          Components: celery, executor
>            Reporter: Robin Miller
>            Assignee: Robin Miller
>            Priority: Minor
>
> When using RabbitMQ as the Celery Results Backend, it is desirable to be able to set the CELERY_TASK_RESULT_EXPIRES config option to reduce the time out period of the task tombstones to less than a day. As such we should pull this option from the airflow.cfg file and pass it through.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)