Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixing keep-alive #406

Merged
merged 8 commits into from
Jun 11, 2015
Merged

Fixing keep-alive #406

merged 8 commits into from
Jun 11, 2015

Conversation

gabtremblay
Copy link
Contributor

Upon testing and touroughly reviewing tcpdump output, it appeared that the client keep-alive functionality was broken, creating a new socket for each request. This patch puts it back in place with minimal test edit.

@asvetlov
Copy link
Member

asvetlov commented Jun 9, 2015

Please fix pep8 error from Travis build

@asvetlov
Copy link
Member

asvetlov commented Jun 9, 2015

I feel you PR is perfect but we need stronger test for keepalives.
Would you add functional test?

Scenario is:

  1. Create aiohttp web server with keepalives enabled. I suggest to use aiohttp.web instead of domestic server used in test_client_functional.py. New test file is good -- call it test_client_functional_newstyle.py for example.
  2. Make keepalive request.
  3. Make sure connection is in the connector after releasing response object.

@gabtremblay
Copy link
Contributor Author

Good point.

asvetlov added a commit that referenced this pull request Jun 11, 2015
@asvetlov asvetlov merged commit 8b68601 into aio-libs:master Jun 11, 2015
@asvetlov
Copy link
Member

Thanks a lot!

@gabtremblay
Copy link
Contributor Author

NP, my pleasure.

@mpaolini
Copy link
Contributor

I think this patch is wrong. Without it I see sockets correclty reused; with it I see single transports/sockets being used by two separate coroutines

mpaolini pushed a commit to elastic-coders/aiohttp that referenced this pull request Aug 22, 2015
Issues aio-libs#253 and aio-libs#254 implemented a `_conns` key evince logic in the
function that actually **adds** items to `_conns`

Issue aio-libs#406 tweaked this logic even more, making early and eviction
of reusable items in the pool possible.

Here we put the key eviction logic where it belongs: in the method
that **removes** items from the `_conns` pool.
@mpaolini mpaolini mentioned this pull request Aug 22, 2015
asvetlov pushed a commit that referenced this pull request Aug 28, 2015
Issues #253 and #254 implemented a `_conns` key evince logic in the
function that actually **adds** items to `_conns`

Issue #406 tweaked this logic even more, making early and eviction
of reusable items in the pool possible.

Here we put the key eviction logic where it belongs: in the method
that **removes** items from the `_conns` pool.
@lock
Copy link

lock bot commented Oct 30, 2019

This thread has been automatically locked since there has not been
any recent activity after it was closed. Please open a new issue for
related bugs.

If you feel like there's important points made in this discussion,
please include those exceprts into that new issue.

@lock lock bot added the outdated label Oct 30, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 30, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants