From 103f78b6a28098e3e97c84b63f6ce0851a0c24ab Mon Sep 17 00:00:00 2001 From: Casey Peel Date: Thu, 31 Dec 2015 09:53:03 -0800 Subject: [PATCH 1/2] Limit new-solr-updater respawning to 10 times in 5 seconds new-solr-updater.py should never require respawning, but if it does because of an error, don't get into a massive respawn spin cycle. If the process respawns 10 times within 5 seconds, stop trying. --- conf/init/ol-solr-updater.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/conf/init/ol-solr-updater.conf b/conf/init/ol-solr-updater.conf index f70271b9779..6b03796bf0b 100644 --- a/conf/init/ol-solr-updater.conf +++ b/conf/init/ol-solr-updater.conf @@ -6,5 +6,6 @@ stop on runlevel [!2345] chdir /openlibrary respawn +respawn limit 10 5 exec sudo -u vagrant python scripts/new-solr-updater.py -c /openlibrary/conf/openlibrary.yml --state-file /openlibrary/solr-update.offset --ol-url http://localhost/ From 79a4f5c7db371b2a2091cf19251c45509a571343 Mon Sep 17 00:00:00 2001 From: Casey Peel Date: Thu, 31 Dec 2015 11:21:06 -0800 Subject: [PATCH 2/2] If ia_db isn't defined in the config, don't load it The ia_db configuration isn't a part of the vagrant devel config and causes a traceback. This allows the ol-solr-updater upstart job to successfully start. --- openlibrary/solr/update_work.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/openlibrary/solr/update_work.py b/openlibrary/solr/update_work.py index dd7335142a9..fbf39de87f8 100644 --- a/openlibrary/solr/update_work.py +++ b/openlibrary/solr/update_work.py @@ -1789,7 +1789,8 @@ def load_configs(c_host,c_config,c_data_provider): conf_file = c_config global _ia_db - _ia_db = get_ia_db(config.runtime_config['ia_db']) + if ('ia_db' in config.runtime_config.keys()): + _ia_db = get_ia_db(config.runtime_config['ia_db']) global data_provider if data_provider == None: