Note that there are some explanatory texts on larger screens.

plurals
  1. POThinkingSphinx3: How to prevent searchd threads from freezing?
    text
    copied!<p>I am using Rails 3.2.12, RSpec-rails 2.13.0 and ThinkingSphinx 3.0.10</p> <p><strong>The problem:</strong> </p> <p>When I run bundle exec rpsec spec/controllers/ads_controller_spec.rb, thinking sphinx spawns 3 searchd processes which become frozen, my tests just lockup until I manually killed the searchd processes after which the tests continue running.</p> <p><strong>The setup:</strong></p> <p>Here is my sphinx_env.rb file which in which I setup TS for testing:</p> <pre><code>require 'thinking_sphinx/test' def sphinx_environment(*tables, &amp;block) obj = self begin before(:all) do obj.use_transactional_fixtures = false ThinkingSphinx::Test.init ThinkingSphinx::Test.start sleep(0.5) end yield ensure after(:all) do ThinkingSphinx::Test.stop sleep(0.5) obj.use_transactional_fixtures = true end end end </code></pre> <p>Here is my test script:</p> <pre><code>describe "GET index" do before(:each) do @web_origin = FactoryGirl.create(:origin) @api_origin = FactoryGirl.create(:api_origin) @first_ad = FactoryGirl.create(:ad, :origin_id =&gt; @web_origin.id) ThinkingSphinx::Test.index #index ads created above sleep 0.5 end sphinx_environment :ads do it 'should return a collection of all live ads' do get :index, {:format =&gt; 'json'} response.code.should == '200' end end ... </code></pre> <p><strong>UPDATE</strong></p> <p>No progress made, however here are some additional details:</p> <ul> <li>When I run my tests, thinking sphinx always starts 3 searchd processes. </li> <li>The pid in my test.sphinx.pid always has just one of the searchd pid's, its always the second searchd process pid.</li> <li><p>Here is the output from my test.searchd.log file:</p> <p>[ 568] binlog: finished replaying total 49 in 0.006 sec</p> <p>[ 568] accepting connections</p> <p>[ 568] caught SIGHUP (seamless=1, in queue=1)</p> <p>[ 568] rotating index 'ad_core': started</p> <p>[ 568] caught SIGHUP (seamless=1, in queue=2)</p> <p>[ 568] caught SIGTERM, shutting down</p></li> </ul> <p>Any help is appreciated, I have been trying to sort out this issue for over a day &amp; a bit lost. </p> <p>Thanks.</p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload