-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stop ol-solr-updater from spinning #281
Stop ol-solr-updater from spinning #281
Conversation
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.
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.
@cpeel are you working on this or should I take the issue? |
@jack17529 - I am not working on this, feel free to take it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can anybody with write access can show me conflicts?
what he did was right .
@@ -6,5 +6,6 @@ stop on runlevel [!2345] | |||
|
|||
chdir /openlibrary | |||
respawn |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should the first respawn be removed (replaced with the second respawn limit 10 5
)? Or should both be present
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mekarpeles how much do you want to respawn the default is set as
Default COUNT is 10. Default INTERVAL is 5 seconds.
If you want to respawn many times use -
respawn limit unlimited
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You want both. The first says to respawn, the second sets a limit. See: http://upstart.ubuntu.com/cookbook/#respawn and http://upstart.ubuntu.com/cookbook/#respawn-limit
@@ -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: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably change this to is None
while we're at it
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh did not notice that PEP 8 says to use is None instead of None.
I believe the changes just need to be rebased against master and the tests will likely pass |
Re-ran CI and no problems -- @cpeel can offer feedback on #281 (review)? If so I'm happy to merge this in. Thanks for pursuing this @jack17529. |
Merged, thanks @cpeel and @jack17529! 🙇 🙇 |
Since ia_db isn't defined in the config, update_work.py throws an exception causing upstart to continually respawn ol-solr-updater resulting in CPU thrashing as the process continuously respawns.
Solve the respawning problem by checking to see if the ia_db key exists in the first place, and protect against future respawn-storms with a respawn limit. This allows ol-solr-updater to start, although I don't have any idea what it does functionally to it (ie: does it still work in the devel vagrant image or just die somewhere else?).