Ensure instance is started before checking for core existence #98
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
@cbeer - does this seem like a plausible diagnosis to you...
It looks to me like the
solr_wrapper
andrake hydra:server
issues being reported in issues like #69 and #92 are timing related. Based on what I can see, it looks likeclient.exists?
check sometimes is issued before the service is fully started. It seems highly dependent on the system you're running on - I can get the failure condition more reliably on an under spec'd VM than I can on my local development laptop.If I modify the core check in lib/solr_wrapper/client.rb to call multiple times and show the responses like the following code does, I frequently see empty responses on the first call or two
Gives me output like
It seems like the instance status check should account for this, but I'm wondering if solr is reporting back a running status before it gives a reasonable response to more complex calls.
I have no idea how I'd write a timing related test. If you have any ideas, I'd be happy to try to add one. I'm also not sure if I've found the best spot to check for the service being started - it seems to reliably fix the particular issue for me, but might not address others related to startup timing.
Behavior on my test system before implementing the proposed change:
solr_wrapper starts, fails 4x, starts on 5th attempt
https://gist.github.com/mark-dce/0a6bb38adde0d5b7645ed58778158575
After adding a check to see if the instance is started, solr_wrapper appears to start reliably every time:
https://gist.github.com/mark-dce/7aaede62802adea79ab826a48af23ad8