sunspot/sunspot — pull request #208 by nz (2012-04-12 02:59:45+00:00)
Title: Retry5xxSessionProxy + graceful reindexing

For your code reviewing pleasure.

Travis build: http://travis-ci.org/#!/sunspot/sunspot/builds/1071595

### sunspot

New `Retry5xxSessionProxy` which will retry a 5xx error once, then gracefully return the Solr response to be parsed by the application.

This thing is basically opt-in and not on by default…

### sunspot_rails

Exception: the `sunspot:reindex` task will now use the `Retry5xxSessionProxy`. I figure this is a pretty reasonable place for it, sine the reindexing is desperately brittle right now and really needs the love.

### TODO

More manual integration testing of the rake task. Please do lend a hand if you have a few minutes. Even just a normal reindex on a test app to help confirm that I haven't screwed anything up.

```ruby
gem 'sunspot_rails', git: 'git://github.com/sunspot/sunspot.git', branch: 'retry_5xx_session_proxy'
```

Still trying to decide how I'm going to set up my testing rig to generate random 500 errors. Probably a little proxymachine app in front of Solr.

/cc @fizx