schoefmann / klarlack

klarlack is a ruby client library for the varnish administration interface. It allows, among other things, purging of cached objects from ruby code.
http://github.com/schoefmax/klarlack
MIT License
73 stars 9 forks source link

fail nicely when varnish is restarted while request is running #3

Closed grosser closed 14 years ago

grosser commented 14 years ago

atm we are testing some issues with freezing rails instances when i notices this not-so-nice error:

10000.times{ EsiHelper.purge_url '^xxxx$' } + sudo /etc/i/varnish restart

nil.split <-> pre>/apps/dawanda/vendor/plugins/klarlack/lib/varnish/client.rb:224:in cmd' /apps/dawanda/vendor/plugins/klarlack/lib/varnish/client.rb:221:insynchronize' /apps/dawanda/vendor/plugins/klarlack/lib/varnish/client.rb:221:in cmd' /apps/dawanda/vendor/plugins/klarlack/lib/varnish/client.rb:138:inpurge'

its no real problem, but it could be a normal Varnish::Error

schoefmann commented 14 years ago

It now fails with a Varnish::BrokenConnection exception (which descends from Varnish::Error)