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 #2189: Wakeup pending waiters #2329

Merged
merged 9 commits into from
Oct 17, 2017
Merged

Conversation

asvetlov
Copy link
Member

Fix for #2189

@fafhrd91 please review.
Sure, I'll add tests if you agree in general.

BTW logic with waiters is too complicated.
Better to rewrite it with asyncio.Condition.

# signal to waiter
waiters = self._waiters[key]
if waiters:
waiter = waiters.pop(0)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think this is required, this could cause IndexError on line 379

Copy link
Member

Choose a reason for hiding this comment

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

maybe you should just call _release_waiter?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yep, figured it out after writing tests.
Please wait for update -- polishing test suite

@fafhrd91
Copy link
Member

I don't think you can use Condition, semaphore maybe. but that is so heavy weight solution

@asvetlov
Copy link
Member Author

Well, let's keep complicated synchronization logic for sake of speed.
Really I don't want to add such intrusive change just before a release.

fafhrd91
fafhrd91 previously approved these changes Oct 16, 2017
@asvetlov
Copy link
Member Author

@fafhrd91 unfortunately self._release_waiter() leads to hung.
I should go.
Could you pick up the PR?
Otherwise I'll continue working on it tomorrow.

@asvetlov
Copy link
Member Author

Nevermind, new implementation passes all tests

fafhrd91
fafhrd91 previously approved these changes Oct 16, 2017
@codecov-io
Copy link

codecov-io commented Oct 17, 2017

Codecov Report

Merging #2329 into master will decrease coverage by <.01%.
The diff coverage is 90.9%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #2329      +/-   ##
==========================================
- Coverage   97.24%   97.23%   -0.01%     
==========================================
  Files          39       39              
  Lines        8217     8224       +7     
  Branches     1440     1442       +2     
==========================================
+ Hits         7991     7997       +6     
  Misses         98       98              
- Partials      128      129       +1
Impacted Files Coverage Δ
aiohttp/connector.py 97.23% <90.9%> (-0.17%) ⬇️

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 a01c4ec...9ebb405. Read the comment docs.

@asvetlov asvetlov merged commit 5d7be5f into master Oct 17, 2017
@asvetlov asvetlov deleted the wakeup-connection-waiter-on-error branch October 17, 2017 09:24
@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
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