- Newest
- Most votes
- Most comments
The key is setting celery.pool equal to solo
Here's our full config:
celery.pool solo
celery.sync_parallelism 1
celery.worker_autoscale 1,1
core.dag_file_processor_timeout 150
core.dagbag_import_timeout 90
core.killed_task_cleanup_time 604800
core.min_serialized_dag_update_interval 60
scheduler.dag_dir_list_interval 300
scheduler.min_file_process_interval 300
scheduler.parsing_processes 2
scheduler.processor_poll_interval 60
scheduler.schedule_after_task_execution false
answered 4 years ago
Hello,
From the error stack trace I see connection timed out issues for the PostGres connection
File "/usr/local/lib64/python3.7/site-packages/sqlalchemy/engine/default.py", line 608, in do_execute cursor.execute(statement, parameters) sqlalchemy.exc.DatabaseError: (psycopg2.DatabaseError) could not receive data from server: Connection timed out
--> But, since you also mentioned that the tasks get stuck for 15 min in status queue and will start running later, I would request for more information from your MWAA environment if it's running multiple DAGs ?
--> I see that the configuration you currently have for celery.worker_autoscale = 5,5, can you please confirm if you are facing the same issue even if the property is set to celery.worker_autoscale = 1,1 ?
This issue needs deeper troubleshooting. I would recommend you to please open a support ticket with MWAA support providing the environment ARN and the time stamp when you faced this issue and we can assist you over screen-share.
REFERENCES:
Hi, thank you very match for the replay. Yes with celery.worker_autoscale = 1,1 issue still there. more information from your MWAA environment if it's running multiple DAGs Yes, we run a few DAGs, even though we have a DAG that runs another DAGs. But this issue faced us when we had run only one simple DAG.
We have the same scenario as Kayelvo. We set celery.pool to solo, which "fixed" the 15/30 min queuing (task delay) issue with the associated timeout errors connecting to the metadata database. However, as soon as we run a few DAGs with a handful of tasks running in parallel, we start seeing tasks delayed. Thus we would also like the root cause of the connection issues resolved so that we can use the default prefork setting. We cannot current set up a truly functional new environment at this time due to this issue (both version 2.0 and 2.2).
answered 4 years ago
we start seeing tasks delayed Hi, looks like its time to up the new worker.
Setting celery.pool equal to solo also worked for me. However, my DAGs runs for a longer time when celery.pool is set to solo since it doesn't use multiprocessing. I would like to use the default celery.pool setting of prefork.
I am noticing this issue on both Airflow 2.2.2 and 2.0.2.
Please have this bug resolved for us.
answered 4 years ago
Relevant content
asked 3 months ago
asked 2 years ago

hello. Thanks you very much, seems like works. I will write here in few days if everything ok.