Avoid Celery/RabbitMQ "connection reset" errors [#5609].
authorFernando Gutierrez <fergtm@nil.mx>
Tue, 12 May 2020 02:25:10 +0000 (12:25 +1000)
committerBen Sturmfels <ben@sturm.com.au>
Tue, 12 May 2020 02:30:35 +0000 (12:30 +1000)
This change starts Celery only after RabbitMQ is available. It also returns the
unnecessarily low BROKER_HEARTBEAT setting to default of 120.0 to help prevent
connections being reset on machines under load.

AUTHORS
docs/source/siteadmin/deploying.rst
mediagoblin/init/celery/__init__.py

diff --git a/AUTHORS b/AUTHORS
index 00838c476deac4ac8ccb8b5805ba23e2d9c419f0..632e8f4ea0c3482ff121ac131c2f3ac68bfb3974 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -45,6 +45,7 @@ Thank you!
 * Duncan Paterson
 * Elrond of Samba TNG
 * Emily O'Leary
+* Fernando Gutierrez
 * Gabi Thume
 * Gabriel Saldana
 * Greg Grossmeier
index 41e67c31010b39772d949eb3fcbf43fd2517b383..e37803252d2c0460b69df360e3e86e57b7462adc 100644 (file)
@@ -528,6 +528,7 @@ environment's setup:
     # Set the WorkingDirectory and Environment values to match your environment.
     [Unit]
     Description=MediaGoblin Celeryd
+    After=rabbitmq-server.service
 
     [Service]
     User=mediagoblin
index 9a67942cbf2b23e1633ced8decdbf65ffb523b13..9fb783bdade3a61fb9f955850035a0f293ea28b6 100644 (file)
@@ -81,7 +81,6 @@ def get_celery_settings_dict(app_config, global_config,
                 'schedule': datetime.timedelta(minutes=frequency),
             }
         }
-        celery_settings['BROKER_HEARTBEAT'] = 1
 
     return celery_settings