I didn't do much - just the one commit since 1.4.3:
https://github.com/freelancing-god/thinking-sphinx/commit/3cc67600da484481ac304237b41d287d9e19a0b3

Stripped out some unused methods (and their specs), reworked one to do what we 
need, with a rescue for the error you're getting.

False is what I'd expect from that code, so that's fine... am defaulting to 
true, though - as there's other rescue blocks that will handle these situations.

-- 
Pat

On 03/03/2011, at 10:03 AM, Aaron Gibralter wrote:

> Alright so I installed from the source and
> 
> User.search_for_id(user.sphinx_document_id, 'user_delta')
> 
> is still false.
> 
> My app works now with cache_classes = true. But... I decided to double check 
> an reinstall the rubygems 1.4.3 version of TS and it still worked... so it 
> the problem must have had to do with the state of the indexes... I'm not sure 
> how to recreate the original problem.
> 
> What did you change in the code?
> 
> On Wed, Mar 2, 2011 at 4:36 AM, Pat Allan <[email protected]> wrote:
> Hi Aaron
> 
> I've just made a change to TS which should hopefully work around this. It'll 
> be a bit fiddly, but can you grab my latest source, and run the following 
> commands:
> 
>  bundle
>  rake build
>  gem install pkg/thinking-sphinx-1.4.3.gem --local
> 
> I just want to confirm it fixes this problem before pushing out a new gem 
> release. Thanks!
> 
> --
> Pat
> 
> On 02/03/2011, at 2:23 AM, Aaron Gibralter wrote:
> 
> > That returns false for me.
> >
> > On Tue, Mar 1, 2011 at 7:08 AM, Pat Allan <[email protected]> wrote:
> > Hi Aaron
> >
> > Sorry for the delay. Here's what I can tell from that stack trace:
> > * the record you're using has delta set to true.
> > * Thinking Sphinx is searching for that record in the delta index...
> >
> > However, delta indexing hasn't happened at that point (if this is the first 
> > edit), so the record doesn't exist in the delta index. So it *should* just 
> > return an empty result set, but it's failing hard.
> >
> > Can you try something for me? After running a full index (so no delta flags 
> > are set), grab a user instance, and run the following:
> >  User.search_for_id(user.sphinx_document_id, 'user_delta')
> >
> > Does it fail? Or return false?
> >
> > --
> > Pat
> >
> > On 25/02/2011, at 4:29 AM, Aaron Gibralter wrote:
> >
> > > Alright here is the stack trace: 
> > > https://gist.github.com/e53720939e66367a23e1
> > >
> > > On Wed, Feb 23, 2011 at 10:37 PM, Aaron Gibralter 
> > > <[email protected]> wrote:
> > > Hmm weird -- I can't seem to recreate it on my mac book pro... I will try 
> > > again when I get to my imac at work tomorrow.
> > >
> > >
> > > On Wed, Feb 23, 2011 at 7:10 PM, Pat Allan <[email protected]> 
> > > wrote:
> > > Huh... so it's on the update, it seems. Can you provide the stack trace? 
> > > And your define_index block?
> > >
> > > --
> > > Pat
> > >
> > > On 24/02/2011, at 11:02 AM, Aaron Gibralter wrote:
> > >
> > > > Hi Pat,
> > > >
> > > > Thanks for the quick reply!
> > > >
> > > > I can get the exception on every request. These are the ingredients of 
> > > > the problem:
> > > >
> > > > * running thin in development mode: `RAILS_ENV=development bundle exec 
> > > > thin start` (perhaps Thin's evented server model causes the connection 
> > > > to searchd to go dead?)
> > > > * having a index defined on my user model
> > > > * using authlogic... when I'm logged in I guess authlogic always 
> > > > updates the user row on every request with the timestamp of the last 
> > > > request... or something like that.
> > > > * having `config.cache_classes = true` in my environment...
> > > >
> > > > Changing any of the last 3 things causes the problem to go away; i.e. 
> > > > if I comment out the index on my user model, or if I am not logged in, 
> > > > or if I turn off cache_classes everything works ok: I can navigate to 
> > > > pages that show search results. It seems like the problem has to do 
> > > > with either an update_attribute or a delta index...
> > > >
> > > >
> > > > On Wed, Feb 23, 2011 at 6:50 PM, Pat Allan <[email protected]> 
> > > > wrote:
> > > > Hi Aaron
> > > >
> > > > I've never seen this in production or development (but going by emails 
> > > > here, plenty of others have). How often is it happening for you? Is it 
> > > > easy to reproduce?
> > > >
> > > > I'm wondering if it's related to the cache_class setting, and maybe 
> > > > that leads to an invalid query being sent to Sphinx. If you can make it 
> > > > happen regularly, perhaps it's worth adding some debug output to TS to 
> > > > find out what query is being generated.
> > > >
> > > > Cheers
> > > >
> > > > --
> > > > Pat
> > > >
> > > > On 24/02/2011, at 7:05 AM, Aaron Gibralter wrote:
> > > >
> > > > > I noticed that I started getting the "No response from searchd" error 
> > > > > when I have the following setup:
> > > > >
> > > > > * development environment
> > > > > * Rails 2.3.10
> > > > > * Thin
> > > > >
> > > > > And I change the following in config/environments/development.rb: 
> > > > > `config.cache_classes = true`
> > > > >
> > > > > Any thoughts?
> > > > >
> > > > > --
> > > > > You received this message because you are subscribed to the Google 
> > > > > Groups "Thinking Sphinx" group.
> > > > > To post to this group, send email to [email protected].
> > > > > To unsubscribe from this group, send email to 
> > > > > [email protected].
> > > > > For more options, visit this group at 
> > > > > http://groups.google.com/group/thinking-sphinx?hl=en.
> > > >
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "Thinking Sphinx" group.
> > > > To post to this group, send email to [email protected].
> > > > To unsubscribe from this group, send email to 
> > > > [email protected].
> > > > For more options, visit this group at 
> > > > http://groups.google.com/group/thinking-sphinx?hl=en.
> > > >
> > > >
> > > >
> > > > --
> > > > You received this message because you are subscribed to the Google 
> > > > Groups "Thinking Sphinx" group.
> > > > To post to this group, send email to [email protected].
> > > > To unsubscribe from this group, send email to 
> > > > [email protected].
> > > > For more options, visit this group at 
> > > > http://groups.google.com/group/thinking-sphinx?hl=en.
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Thinking Sphinx" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to 
> > > [email protected].
> > > For more options, visit this group at 
> > > http://groups.google.com/group/thinking-sphinx?hl=en.
> > >
> > >
> > >
> > >
> > > --
> > > You received this message because you are subscribed to the Google Groups 
> > > "Thinking Sphinx" group.
> > > To post to this group, send email to [email protected].
> > > To unsubscribe from this group, send email to 
> > > [email protected].
> > > For more options, visit this group at 
> > > http://groups.google.com/group/thinking-sphinx?hl=en.
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Thinking Sphinx" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group at 
> > http://groups.google.com/group/thinking-sphinx?hl=en.
> >
> >
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "Thinking Sphinx" group.
> > To post to this group, send email to [email protected].
> > To unsubscribe from this group, send email to 
> > [email protected].
> > For more options, visit this group at 
> > http://groups.google.com/group/thinking-sphinx?hl=en.
> 
> --
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/thinking-sphinx?hl=en.
> 
> 
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "Thinking Sphinx" group.
> To post to this group, send email to [email protected].
> To unsubscribe from this group, send email to 
> [email protected].
> For more options, visit this group at 
> http://groups.google.com/group/thinking-sphinx?hl=en.

-- 
You received this message because you are subscribed to the Google Groups 
"Thinking Sphinx" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/thinking-sphinx?hl=en.

Reply via email to