travis-ci/travis-core — pull request #175 by svenfuchs (2013-01-21 15:43:22+00:00)
Title: [wip] make worker heartbeats/data use redis

The current implementation of worker heartbeats is inherently flawed and now regularly hits a wall when the db gets so slow that heartbeat messages can't be processed in time. If that happens the vacuum process will start removing all workers even though heartbeats for many of them are present (but not yet processed). If that happens the app will start sending worker update pusher notifications for every heartbeat of every single vm, i.e. tons of them.

This branch moves worker data to redis.

Missing bits:

* Expiration notification thread that compares the "workers" set to the ids of all existing worker records and sends out notifications for workers that have been expired by redis.
* Possibly an index on full_name so that we can select them more efficiently instead of loading all records to memory and iterating over them. Otoh this might just be fine because we're talking about dozens, not thousands of small records.