antirez/redis — pull request #488 by pietern (2012-04-30 17:20:47+00:00)
Title: Use safe dictionary iterator from KEYS (fixes #487)

Every matched key in a KEYS call is checked for expiration. When the key is set to expire, the call to `getExpire` will assert that the key also exists in the main dictionary. This in turn causes a rehashing step to be executed. Rehashing a dictionary when there is an iterator active may result in the iterator emitting duplicate entries, or not emitting some entries at all. By using a safe iterator, the rehash step is omitted.

This fixes #487.