repoze/repoze.lru — Issue #6: LRUCache is not thread safe
Author: snordhausen
Created: 2012-01-13 13:21:23+00:00
State: open

When the clear() method is called on a LRUCache, concurrently running get() and put() calls may throw exceptions.

The get() method may throw an exception because it tries to
self.clock[pos]['ref'] = True
but the clear() method is only slowly rebuilding the self.clock list. This results in index out of bounds.

put() may except when it is searching for a place to put an item. put() walks along self.clock and can experience index out of bounds just like the get() method.