tavisrudd/redis-clojure — pull request #3 by ptaoussanis (2011-12-24 07:35:34+00:00)
Title: Attempted fix for "Broken Pipe" exception

Hi Travis,

I've had problems getting redis-clojure 1.3.0 to work reliably. After some amount of time, a call to (with-server...) will throw an "End of stream reached" exception, after which all further calls throw "Broken pipe".

Whatever the cause, it seems intermittent: I haven't been able to reproduce the issue reliably.

Now I'm not familiar with Commons Pool (or Redis for that matter), but I did notice that you were defining a (release-connection) method that takes an exception and calls .invalidateObject. But this form of release-connection wasn't ever getting called.

Anyway, as a stab-in-the-dark, I tried a change here to invalidate broken connections on exceptions.

Since the error is so difficult to reproduce, I can't tell for sure whether this has helped or not- but, anecdotally, I haven't seen any broken pipes since the change and I haven't noticed any regressions in my simple case.

Happy holidays, cheers!

--
Peter (p.taoussanis@gmail.com)