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

Fix connector #2567

Merged
merged 6 commits into from
Nov 29, 2017
Merged

Fix connector #2567

merged 6 commits into from
Nov 29, 2017

Conversation

asvetlov
Copy link
Member

Prevent hang on connection acquiring after connection failure

@codecov-io
Copy link

codecov-io commented Nov 28, 2017

Codecov Report

Merging #2567 into 2.3 will decrease coverage by <.01%.
The diff coverage is 87.5%.

Impacted file tree graph

@@            Coverage Diff             @@
##              2.3    #2567      +/-   ##
==========================================
- Coverage   97.35%   97.34%   -0.01%     
==========================================
  Files          39       39              
  Lines        8253     8260       +7     
  Branches     1437     1439       +2     
==========================================
+ Hits         8035     8041       +6     
  Misses         96       96              
- Partials      122      123       +1
Impacted Files Coverage Δ
aiohttp/connector.py 97.34% <87.5%> (-0.16%) ⬇️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 4e7a2c4...8d6a0ca. Read the comment docs.

@@ -343,6 +343,28 @@ def test_release_close(loop):
assert proto.close.called


def test__drop_acquire_per_host1(loop):
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@asvetlov is this double__underscore notation intentional?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes. It is a test for _drop_acquire_per_host method.

@pfreixes
Copy link
Contributor

Why the clients that are waiting for an available connection hang in case of the previous one had an error? I cant see this bad behavior in the current code. Could you please point me to the right path?

Also, I don't get the point of the test_error_in_performing_request test, how is it testing that situation?

@asvetlov
Copy link
Member Author

self._waiters was not cleaned up, https://github.com/aio-libs/aiohttp/blob/2.3/aiohttp/connector.py#L357 said that available is not positive.
connect() method created a waiter but no other connection was exist, nobody set resumed the waiter future.

That's why test_error_in_performing_request failed.

I need review the logic for available, looks like len(self._waiters) is a wrong check.

@asvetlov
Copy link
Member Author

Dropped a check for len(self._waiters), self._acquired is enough.

@pfreixes
Copy link
Contributor

Oks, got it. LGTM can be merged once all checks passes

@pfreixes
Copy link
Contributor

IMHO this kind of bug is enough important to have a bugfix release for the 2.X series

@asvetlov
Copy link
Member Author

@pfreixes will publish 2.3.4 just after merging

@lock
Copy link

lock bot commented Oct 28, 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].
[new issue]: https://github.com/aio-libs/aiohttp/issues/new

@lock lock bot added the outdated label Oct 28, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 28, 2019
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Oct 28, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bot:chronographer:provided There is a change note present in this PR outdated
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants