{"issue":{"state":"open","pull_request":{"diff_url":null,"html_url":null,"patch_url":null},"user":{"avatar_url":"https://secure.gravatar.com/avatar/07b05fe72c5064281274705051d523b6?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"07b05fe72c5064281274705051d523b6","url":"https://api.github.com/users/christer","login":"christer","id":63446},"milestone":null,"labels":[],"updated_at":"2011-11-04T16:31:15Z","assignee":null,"comments":3,"closed_at":null,"url":"https://api.github.com/repos/shazow/urllib3/issues/7","body":"I'm testing 1.0.1\r\n\r\nAs noted in the code, RecentlyUsedContainer is not threadsafe.\r\n\r\nI'm getting:  RuntimeError: deque mutated during iteration\r\n\r\nStacktrace:\r\n\r\n```\r\n  File \"/home/chrsjo/src/arkenutils_omkomp/arken/hcap.py\", line 153, in _request\r\n    return self._pool.request(*args, **kwargs)\r\n  File \".../urllib3-1.0.1-py2.7.egg/urllib3/request.py\", line 65, in request\r\n    **urlopen_kw)\r\n  File \".../urllib3-1.0.1-py2.7.egg/urllib3/request.py\", line 78, in request_encode_url\r\n    return self.urlopen(method, url, **urlopen_kw)\r\n  File \".../urllib3-1.0.1-py2.7.egg/urllib3/poolmanager.py\", line 107, in urlopen\r\n    conn = self.connection_from_url(url)\r\n  File \".../urllib3-1.0.1-py2.7.egg/urllib3/poolmanager.py\", line 98, in connection_from_url\r\n    return self.connection_from_host(host, port=port, scheme=scheme)\r\n  File \".../urllib3-1.0.1-py2.7.egg/urllib3/poolmanager.py\", line 73, in connection_from_host\r\n    pool = self.pools.get(pool_key)\r\n  File \"/home/chrsjo/.virtualenvs/arkenutils_omkomp/lib/python2.7/_abcoll.py\", line 342, in get \r\n    return self[key]\r\n  File \".../urllib3-1.0.1-py2.7.egg/urllib3/_collections.py\", line 96, in __getitem__\r\n    self._prune_invalidated_entries()\r\n  File \".../urllib3-1.0.1-py2.7.egg/urllib3/_collections.py\", line 77, in _prune_invalidated_entries\r\n    self.access_log = deque(e for e in self.access_log if e.is_valid)\r\n  File \".../urllib3-1.0.1-py2.7.egg/urllib3/_collections.py\", line 77, in <genexpr>\r\n    self.access_log = deque(e for e in self.access_log if e.is_valid)\r\nRuntimeError: deque mutated during iteration\r\n\r\n```\r\n\r\n","html_url":"https://github.com/shazow/urllib3/issues/7","title":"RecentlyUsedContainer is not threadsafe","number":7,"id":2142459,"created_at":"2011-11-04T10:32:28Z"},"action":"created","comment":{"user":{"avatar_url":"https://secure.gravatar.com/avatar/c355dd26a5f80e1605d2ff1ecb6e719e?d=https://a248.e.akamai.net/assets.github.com%2Fimages%2Fgravatars%2Fgravatar-140.png","gravatar_id":"c355dd26a5f80e1605d2ff1ecb6e719e","url":"https://api.github.com/users/shazow","login":"shazow","id":6292},"updated_at":"2011-11-04T16:31:15Z","url":"https://api.github.com/repos/shazow/urllib3/issues/comments/2633056","body":"I ported over your changes to <Py26 (acquire/release instead of ``with``) and made some other minor improvements here:\r\n\r\nhttps://github.com/shazow/urllib3/commit/4a6869050824159359f6445830965eb5eef303c1\r\n\r\nI'm wondering whether we should expand the scope of the mutex to the entire methods rather than just that one deque. Hmm. Or perhaps I'll write some of the surrounding code a bit more defensively.","id":2633056,"created_at":"2011-11-04T16:31:15Z"}}