airflow icon indicating copy to clipboard operation
airflow copied to clipboard

Issues with scheduler (using celery) after upgrade to 1.6.1

Open smueller1245 opened this issue 10 years ago • 12 comments

Hi,

First, many thanks for developing and open sourcing Airflow. We have been using it for the past few months and it has greatly improved our workflow process.

After upgrading to 1.6.1, we've had a few troubles with the scheduler.

  1. Pools that existed prior to the upgrade will not run jobs anymore. We created new pools with different names and assigned our dags to them.
  2. Sometimes, though a DAG run will start (can see this in the UI and in the scheduler logs), the tasks for that DAG run will not be queued.
  3. Sometimes there is a long delay between the time when a task gets queued and when it gets worked on, even if there are available slot in the pool.

I was doing some research and noticed that here (https://groups.google.com/forum/#!topic/airbnb_airflow/Bf-7YASKD2U) and in #698 it was recommended to run the scheduler for 5 runs at a time before restarting it. This seems to have helped some.

For the third issue, I noticed a 20 minute delay between seeing this in the scheduler logs: 2015-12-10 17:27:38,852 - root - INFO - Adding to queue: airflow run Airflow-Scheduler-Monitor heartbeat 2015-12-10T16:31:00 --local -sd DAGS_FOLDER/scheduler-monitor.py

And seeing this in the worker log: Logging into: /r9/airflow/logs/Airflow-Scheduler-Monitor/heartbeat/2015-12-10T16:31:00

Is there a good way to look at whats happening between these two log messages, either with more logging or connecting to look at the celery queues?

Thanks, Stephen

smueller1245 avatar Dec 11 '15 19:12 smueller1245

Hi Stephen,

I was just wondering if these problems were resolved? Also, do you know if this problem is specific to using celery?

Thanks,

Matt

matthewdavidhauser avatar Dec 21 '15 16:12 matthewdavidhauser

@matthewdavidhauser I'm wondering if this could be a celery issue with sqlacademy as a broker... do you think changing to RabbitMQ or Redis might be a good thing to try?

NeilHanlon avatar Dec 21 '15 19:12 NeilHanlon

@NeilHanlon don't have much insight on that one- I've just been using the local executor and hadn't seen any issues so far

matthewdavidhauser avatar Dec 22 '15 02:12 matthewdavidhauser

Hi Neil and Matt, thank you for the replies. Neil, good to hear from you :)

We have been using celery with mysql/sqlalchemy as the broker. I will give RabbitMQ a try.

Thanks!

smueller1245 avatar Dec 22 '15 14:12 smueller1245

In case anyone is seeing similar issues: I found that you can run the "airflow flower" command and go to http://:8383 to use the flower UI to monitor celery.

smueller1245 avatar Dec 22 '15 15:12 smueller1245

FYI, we (Agari) use the local executor instead of the celery executor. We moved from 1.5.1 to 1.6.1+ (HEAD master) and did not notice any issues with scheduling and our pool. We did not need to recreate any pools, so this sounds like a celery specify problem. It would be good if you changed the title of this issue to reflect that. We run airflow in both staging and prod, so we did the upgrade (via git pull, python setup.py install, and airflow upgradedb) to both without any issues.

r39132 avatar Dec 23 '15 00:12 r39132

Is this still an issue? Otherwise is seems more an issue for the mailinglist. Closing for now here otherwise create Jira.

bolkedebruin avatar May 08 '16 12:05 bolkedebruin

@bolkedebruin I believe we put in a PR to fix the issues, and we also switched over to rabbitmq as a broker which seemed to help as well.

NeilHanlon avatar May 08 '16 23:05 NeilHanlon

@NeilHanlon Wondering which airflow version has your fix for this issue? We're also bitten by it recently using airflow 1.6.2 + celery. Thanks!

reconditesea avatar May 12 '16 07:05 reconditesea

@reconditesea 1.7.1*, most likely out next week will contain a lot of scheduler fixes including this one.

  • given no new blockers

bolkedebruin avatar May 12 '16 09:05 bolkedebruin

@reconditesea https://github.com/apache/incubator-airflow/pull/1135 I believe is the PR

NeilHanlon avatar May 12 '16 13:05 NeilHanlon

Thank you @bolkedebruin, @NeilHanlon !

reconditesea avatar May 12 '16 17:05 reconditesea