playframework / play-plugins

CachePlugin
444 stars 161 forks source link

Redis server offline should not throw exceptions up through the Cache API trait. #171

Closed rmmeans closed 7 years ago

rmmeans commented 8 years ago

The get method correctly handled any exceptions raised by Jedis by returning a None, but then your code would probably fetch the real value from the original source (or use getOrElse) and then try to set it into cache for the next request. The set method did not catch exceptions other than IOExceptions which was not enough to catch issues with Jedis not being able to connect to Redis.

The end result was if Redis was down, this plugin would result in the CacheAPI throwing up unexpected exceptions into your application code. This should resolve this issue.