{"action":"created","issue":{"url":"https://api.github.com/repos/andymccurdy/redis-py/issues/1138","repository_url":"https://api.github.com/repos/andymccurdy/redis-py","labels_url":"https://api.github.com/repos/andymccurdy/redis-py/issues/1138/labels{/name}","comments_url":"https://api.github.com/repos/andymccurdy/redis-py/issues/1138/comments","events_url":"https://api.github.com/repos/andymccurdy/redis-py/issues/1138/events","html_url":"https://github.com/andymccurdy/redis-py/issues/1138","id":412558698,"node_id":"MDU6SXNzdWU0MTI1NTg2OTg=","number":1138,"title":"KeyError on self._in_use_connections.remove(connection)","user":{"login":"jkamashian","id":11789055,"node_id":"MDQ6VXNlcjExNzg5MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/11789055?v=4","gravatar_id":"","url":"https://api.github.com/users/jkamashian","html_url":"https://github.com/jkamashian","followers_url":"https://api.github.com/users/jkamashian/followers","following_url":"https://api.github.com/users/jkamashian/following{/other_user}","gists_url":"https://api.github.com/users/jkamashian/gists{/gist_id}","starred_url":"https://api.github.com/users/jkamashian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkamashian/subscriptions","organizations_url":"https://api.github.com/users/jkamashian/orgs","repos_url":"https://api.github.com/users/jkamashian/repos","events_url":"https://api.github.com/users/jkamashian/events{/privacy}","received_events_url":"https://api.github.com/users/jkamashian/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2019-02-20T18:07:38Z","updated_at":"2019-02-25T18:24:52Z","closed_at":null,"author_association":"NONE","body":"**Version**: 2.10.5\r\n**Platform**: Python 2.7, Ubuntu \r\nThis is a very rare occurrence on a very high traffic server but I receive a key error occasionally from here:\r\n`self._in_use_connections.remove(connection)`\r\nhttps://github.com/andymccurdy/redis-py/blob/2.10.5/redis/connection.py#L913\r\nI haven't been able to reproduce this in testing or root out the cause.\r\n\r\nTheories: \r\n`self._available_connections` is a `list` so you could  `append` in the same connection more then once. Then when you try to `self._in_use_connections.add(connection)` \r\nhttps://github.com/andymccurdy/redis-py/blob/2.10.5/redis/connection.py#L898\r\nYou get no error for using the same connection. Until you try to release `_in_use_connections` is a `set` so were the `add()` multiple times desen't raise an error `remove()` will."},"comment":{"url":"https://api.github.com/repos/andymccurdy/redis-py/issues/comments/467122255","html_url":"https://github.com/andymccurdy/redis-py/issues/1138#issuecomment-467122255","issue_url":"https://api.github.com/repos/andymccurdy/redis-py/issues/1138","id":467122255,"node_id":"MDEyOklzc3VlQ29tbWVudDQ2NzEyMjI1NQ==","user":{"login":"jkamashian","id":11789055,"node_id":"MDQ6VXNlcjExNzg5MDU1","avatar_url":"https://avatars2.githubusercontent.com/u/11789055?v=4","gravatar_id":"","url":"https://api.github.com/users/jkamashian","html_url":"https://github.com/jkamashian","followers_url":"https://api.github.com/users/jkamashian/followers","following_url":"https://api.github.com/users/jkamashian/following{/other_user}","gists_url":"https://api.github.com/users/jkamashian/gists{/gist_id}","starred_url":"https://api.github.com/users/jkamashian/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jkamashian/subscriptions","organizations_url":"https://api.github.com/users/jkamashian/orgs","repos_url":"https://api.github.com/users/jkamashian/repos","events_url":"https://api.github.com/users/jkamashian/events{/privacy}","received_events_url":"https://api.github.com/users/jkamashian/received_events","type":"User","site_admin":false},"created_at":"2019-02-25T18:24:52Z","updated_at":"2019-02-25T18:24:52Z","author_association":"NONE","body":"So this is a Flask(Nginx+) I think threaded Is the correct answer for this. "}}
{"actor":{"display_login":"jkamashian"}}