Websolr will be entering a maintenance window at 9pm PST tonight (1/20/10). There may not be any downtime if things go smoothly, but if there are any issues, it may be down for a little while. This should be the last maintenance window in the beta period.
Historically, both sunspot_rails and acts_as_solr throw exceptions left and right when a Solr server goes down, rendering your application nearly unusable. This is because they both use after_save hooks. When the hook fails, every save fails and every page that tries to save returns an Internal Server Error.
While websolr has become much more stable recently, and we are now past the point in the beta where unexpected downtime is common, I’m implementing changes in the libraries to make sure that your app remains usable in the face of potential websolr downtime.
During potential websolr downtime, you should only see exceptions when a user actually performs a search. In this case, you should catch the exception and return an error page.
For acts_as_solr users:
- Upgrade to the latest plugin via:
./script/plugin install –force git://github.com/onemorecloud/acts_as_solr.git
- Catch ActsAsSolr::ConnectionError in your search page.
- Re-index after the downtime via rake solr:reindex
For sunspot users:
- The patch is included in versions of websolr-rails >= 2.3
- Catch RSolr::RequestError in your search page
- Re-index after the downtime via calling ./script/runner “ModelName.reindex”
If you actually went the gem install remind route (now hosted on gemcutter), I just added the ability to watch one or more existing processes for termination.
Syntax:
$ remind <command> [<arguments>]
$ remind <pid>
I always find myself running multiple 30-second bash tasks. Often, I start something new (or just read the news) while waiting. Sometimes, I just keep coming back to the task. Either way, it’s wasted time and mental cycles that adds up quickly.
Enter Growl. Growl is a notifications framework for OS X. It pops up little customizable windows whenever it receives events. Many applications like Adium, Dropbox, Gmail Notifier use this, but it also has a command-line interface that you can (and should) use!
growlnotify -m "Your message" "Your header"
I often use this like:
./some-long-task; growlnotify -m "is done" "some-long-task"
That’s a little long, so I made a quick script that you can use like:
remind ./some-long-task
You can download it at http://gist.github.com/200850, or run
gem sources -a http://gemcutter.org
gem install remind
Other key places to use Growl:
- I put a system call to growlnotify at the end of my deployment script.
- Unit test results via Growl
Can you think of more uses?