Tapjoy/sensu — pull request #2 by will-ob (2013-01-08 19:21:47+00:00)
Title:  [API] "GET /clients" should not throw 500 if a client key is invalid

Ran into some strange behavior. In production, we are mysteriously losing client keys in redis. I have not been able to reproduce this on a local machine. Client deletion is only ever done through the API but I don't see where that code could go awry unless the client key were already missing.

So the client key (eg 'client:8771-b01dface-dead-ba5eba11') is missing, but the 'clients' set in redis still includes '8771-b01dface-dead-ba5eba11'. Events, history, and the like are also present still. `GET /clients` returns a status code of 500 because the 'clients' set in redis points to a null key.

This is a band-aid solution to ensure one bad client can't take down the whole API.
If anyone knows who's stealing my keys..