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 bug with https proxy acquired cleanup #1340 #1450

Merged
merged 9 commits into from
Dec 11, 2016

Conversation

kserhii
Copy link
Contributor

@kserhii kserhii commented Dec 4, 2016

What do these changes do?

This pull request fix bug with https proxy acquired cleanup.
When TCPConnector creates a proxy connection, it adds a transport to the acquired and then sends CONNECT request. But after that TCPConnector detach the transport and does not remove them from the acquired. This caused a memory leak when https proxy connection had used.

Are there changes in behavior for the user?

No.

Related issue number

#1340

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • Add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new entry to CHANGES.rst
    • Choose any open position to avoid merge conflicts with other PRs.
    • Add a link to the issue you are fixing (if any) using #issue_number format at the end of changelog message. Use Pull Request number if there are no issues for PR or PR covers the issue only partially.


assert 0 == len(conn._acquired[key])

sess.close()
Copy link
Member

Choose a reason for hiding this comment

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

close is coroutine, and connector should probably be closed too but not sure.

Copy link
Member

Choose a reason for hiding this comment

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

yield from sess.close() is enough, session takes ownership of connector.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yep, my mistake.

@codecov-io
Copy link

codecov-io commented Dec 5, 2016

Current coverage is 98.85% (diff: 100%)

Merging #1450 into master will increase coverage by 0.01%

@@             master      #1450   diff @@
==========================================
  Files            30         30          
  Lines          6963       6973    +10   
  Methods           0          0          
  Messages          0          0          
  Branches       1155       1159     +4   
==========================================
+ Hits           6882       6893    +11   
  Misses           40         40          
+ Partials         41         40     -1   

Powered by Codecov. Last update 7011455...6598e8b

@asvetlov
Copy link
Member

asvetlov commented Dec 8, 2016

Please take a look on Windows failed tests

@kserhii
Copy link
Contributor Author

kserhii commented Dec 8, 2016

Tests fails with the message:
OSError: [WinError 10038] An operation was attempted on something that is not a socket
but I can't understand why this happened.
Maybe you have an idea?

@asvetlov
Copy link
Member

asvetlov commented Dec 8, 2016

Maybe you do mocking too much or not enough? :)

@kserhii kserhii force-pushed the https_proxy_cleanup_fix branch from 1a1b5d8 to 1dc8631 Compare December 10, 2016 16:54
@kserhii kserhii force-pushed the https_proxy_cleanup_fix branch from c2d78cd to cde1672 Compare December 10, 2016 21:31
@kserhii
Copy link
Contributor Author

kserhii commented Dec 10, 2016

The problem was with unclosed proxy transport. Now everything is done.

@asvetlov asvetlov merged commit add3bd9 into aio-libs:master Dec 11, 2016
@asvetlov
Copy link
Member

Perfect!

@kserhii kserhii deleted the https_proxy_cleanup_fix branch December 12, 2016 19:29
@lock
Copy link

lock bot commented Oct 29, 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 29, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 29, 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.

4 participants