shazow/urllib3 — Issue #7: RecentlyUsedContainer is not threadsafe
Author: christer
Created: 2011-11-04 10:32:28+00:00
State: open

I'm testing 1.0.1

As noted in the code, RecentlyUsedContainer is not threadsafe.

I'm getting: RuntimeError: deque mutated during iteration

Stacktrace:

```
File "/home/chrsjo/src/arkenutils_omkomp/arken/hcap.py", line 153, in _request
return self._pool.request(*args, **kwargs)
File ".../urllib3-1.0.1-py2.7.egg/urllib3/request.py", line 65, in request
**urlopen_kw)
File ".../urllib3-1.0.1-py2.7.egg/urllib3/request.py", line 78, in request_encode_url
return self.urlopen(method, url, **urlopen_kw)
File ".../urllib3-1.0.1-py2.7.egg/urllib3/poolmanager.py", line 107, in urlopen
conn = self.connection_from_url(url)
File ".../urllib3-1.0.1-py2.7.egg/urllib3/poolmanager.py", line 98, in connection_from_url
return self.connection_from_host(host, port=port, scheme=scheme)
File ".../urllib3-1.0.1-py2.7.egg/urllib3/poolmanager.py", line 73, in connection_from_host
pool = self.pools.get(pool_key)
File "/home/chrsjo/.virtualenvs/arkenutils_omkomp/lib/python2.7/_abcoll.py", line 342, in get
return self[key]
File ".../urllib3-1.0.1-py2.7.egg/urllib3/_collections.py", line 96, in __getitem__
self._prune_invalidated_entries()
File ".../urllib3-1.0.1-py2.7.egg/urllib3/_collections.py", line 77, in _prune_invalidated_entries
self.access_log = deque(e for e in self.access_log if e.is_valid)
File ".../urllib3-1.0.1-py2.7.egg/urllib3/_collections.py", line 77, in
self.access_log = deque(e for e in self.access_log if e.is_valid)
RuntimeError: deque mutated during iteration

```