If network resource returns keepalive response an implicit connection is not closed now.
That's leads to resource leaks and eventually to OSError: [Errno 24] Too many open files.
I guess to always close implicit connection and process keepalives only if explicit connector has been passed to aiohttp.request.
OSError: [Errno 24] Too many open files
See http://stackoverflow.com/questions/24298095/connections-arent-closing-with-python3-asyncio-concurrent-http-get-requests/24312441?noredirect=1 as initial report for the issue
Always close implicit connector, even for keepalive responses.
I think 'force_close' should be TCPConnector parameter. should we also introduce keep-alive timer for each opened connection, similar to what server handler does?
force_close for TCPConnector only or for BaseConnector also?
I like the second.
About keep-alive timer -- nice to have, but timer can be implemented in another issue.
Agree on both
Move force_close to argument for Connector object
New patch is ready.
@fafhrd91 please review.
I think the fix worth to be published in 0.8.2 ASAP.
BTW I've got the same in my production code but did not figure out the source of problem.
After looking on stack overflow issue we've changed own code to explicit connector usage last Friday, but maybe some user will catch the same error.
ok, i'll make release later today.
Thank you again.
@asvetlov and @fafhrd91. Thanks for fixing this! I was wondering what was going on.