{"action":"created","issue":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/1061","repository_url":"https://api.github.com/repos/KeepSafe/aiohttp","labels_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/1061/labels{/name}","comments_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/1061/comments","events_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/1061/events","html_url":"https://github.com/KeepSafe/aiohttp/issues/1061","id":170192787,"number":1061,"title":"Cookie expiration timers keep piling up in the asyncio event loop","user":{"login":"operutka","id":1826328,"avatar_url":"https://avatars.githubusercontent.com/u/1826328?v=3","gravatar_id":"","url":"https://api.github.com/users/operutka","html_url":"https://github.com/operutka","followers_url":"https://api.github.com/users/operutka/followers","following_url":"https://api.github.com/users/operutka/following{/other_user}","gists_url":"https://api.github.com/users/operutka/gists{/gist_id}","starred_url":"https://api.github.com/users/operutka/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/operutka/subscriptions","organizations_url":"https://api.github.com/users/operutka/orgs","repos_url":"https://api.github.com/users/operutka/repos","events_url":"https://api.github.com/users/operutka/events{/privacy}","received_events_url":"https://api.github.com/users/operutka/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/KeepSafe/aiohttp/labels/client","name":"client","color":"bfd4f2"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2016-08-09T15:14:42Z","updated_at":"2016-08-30T17:06:52Z","closed_at":null,"body":"Hi,\r\n\r\nI have a problem with my application since aiohttp 0.22. The application makes a lot of requests to an external REST API. It uses the aiohttp basic API and it suffers from significant slow down as the asyncio event loop gets flooded with cookie expiration timers. I know that the basic API is not effective in general as it creates a new session for every request. However, it makes no difference in my case. The external server closes connection after every request so there are no keep-alive connections and the basic API is much more comfortable in this case.\r\n\r\nThe CookieJar sets up a new expiration timer on every cookie update. In request-heavy applications, it leads to flooding the asyncio event loop with timer tasks effectively slowing down the whole process.\r\n\r\nIn my opinion, the expiration timers should be canceled on updates of existing cookies and replaced with new ones. In case of the basic API, the default CookieJar should be replaced with a dummy one to avoid scheduling the timers at all. No cookie storage is needed in case of the basic API.\r\n\r\nMoreover, the CookieJar implementation does not need to use the timers at all. You can simply remove expired cookies when you access them."},"comment":{"url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/comments/243509187","html_url":"https://github.com/KeepSafe/aiohttp/issues/1061#issuecomment-243509187","issue_url":"https://api.github.com/repos/KeepSafe/aiohttp/issues/1061","id":243509187,"user":{"login":"asvetlov","id":356399,"avatar_url":"https://avatars.githubusercontent.com/u/356399?v=3","gravatar_id":"","url":"https://api.github.com/users/asvetlov","html_url":"https://github.com/asvetlov","followers_url":"https://api.github.com/users/asvetlov/followers","following_url":"https://api.github.com/users/asvetlov/following{/other_user}","gists_url":"https://api.github.com/users/asvetlov/gists{/gist_id}","starred_url":"https://api.github.com/users/asvetlov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/asvetlov/subscriptions","organizations_url":"https://api.github.com/users/asvetlov/orgs","repos_url":"https://api.github.com/users/asvetlov/repos","events_url":"https://api.github.com/users/asvetlov/events{/privacy}","received_events_url":"https://api.github.com/users/asvetlov/received_events","type":"User","site_admin":false},"created_at":"2016-08-30T17:06:52Z","updated_at":"2016-08-30T17:06:52Z","body":"`0.21.6` I believe"}}
{"actor":{"display_login":"asvetlov"}}