freelancing-god/thinking-sphinx — Issue #308: Timeouts, handshaking errors when rotating indexes
Author: runa
Created: 2011-11-16 19:03:52+00:00
State: open

Hey!

We're using thinking sphinx with 2 sphinx servers, configured in sphinx.yml as 2 "addresses"; also we have timeout: 1

We rotate indexes, first on one server, a few seconds later on the other. When indexes are being rotated, we found different problems:

This looks like a handshaking problem:

undefined method `index' for nil:NilClass
/var/www/foo/shared/bundle/ruby/1.9.1/gems/riddle-1.4.0/lib/riddle/client.rb:569:in `initialise_socket'

I've no idea about this one:

undefined method `[]' for nil:NilClass
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/search.rb:245:in `total_pages'

Maybe this one is not a big deal:

index job_keyword_search_link_br_core: index not preread
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/search.rb:398:in `block in populate'
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/search.rb:543:in `call'
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/search.rb:543:in `retry_on_stale_index'
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/search.rb:385:in `populate'
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/search.rb:167:in `method_missing'

This one surprises me since I expected TS to try the second connection (or maybe it did and it ended up throwing the exception when it ran out of backend servers?)

Connection timed out - connect(2)
riddle (1.4.0) lib/riddle/client.rb:572:in `initialize'
riddle (1.4.0) lib/riddle/client.rb:572:in `new'
riddle (1.4.0) lib/riddle/client.rb:572:in `initialise_socket'
riddle (1.4.0) lib/riddle/0.9.9/client.rb:8:in `initialise_connection'
riddle (1.4.0) lib/riddle/client.rb:498:in `open_socket'
riddle (1.4.0) lib/riddle/client.rb:535:in `connect'
riddle (1.4.0) lib/riddle/client.rb:620:in `request'
riddle (1.4.0) lib/riddle/client.rb:226:in `run'
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/bundled_search.rb:39:in `populate'
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/bundled_search.rb:20:in `searches'
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/search.rb:69:in `bundle_searches'
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/facet_search.rb:49:in `populate'
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/facet_search.rb:13:in `initialize'
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/search_methods.rb:422:in `new'
/var/www/foo/shared/bundle/ruby/1.9.1/gems/thinking-sphinx-1.4.6/lib/thinking_sphinx/search_methods.rb:422:in `facets'

Any hints? we could debug this deeper if you want. Thanks!