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 #4013 _resolve_host race conditions #4014

Merged
merged 6 commits into from
Aug 31, 2019

Conversation

ojii
Copy link
Contributor

@ojii ojii commented Aug 29, 2019

What do these changes do?

Fixes #4013 by removing possible context switches between dictionary/cache tests and accessing those dictionaries/caches.

Are there changes in behavior for the user?

Related issue number

Fixes #4013

Checklist

  • I think the code is well written
  • Unit tests for the changes exist
  • Documentation reflects the changes
  • If you provide code modification, please add yourself to CONTRIBUTORS.txt
    • The format is <Name> <Surname>.
    • Please keep alphabetical order, the file is sorted by names.
  • Add a new news fragment into the CHANGES folder
    • name it <issue_id>.<type> for example (588.bugfix)
    • if you don't have an issue_id change it to the pr id after creating the pr
    • ensure type is one of the following:
      • .feature: Signifying a new feature.
      • .bugfix: Signifying a bug fix.
      • .doc: Signifying a documentation improvement.
      • .removal: Signifying a deprecation or removal of public API.
      • .misc: A ticket has been closed, but it is not of interest to users.
    • Make sure to use full sentences with correct case and punctuation, for example: "Fix issue with non-ascii contents in doctest text files."

@ojii ojii requested a review from asvetlov as a code owner August 29, 2019 07:48
@webknjaz
Copy link
Member

webknjaz commented Aug 29, 2019

@ojii this PR causes linter failures. Please fix those and go through the checklist above ☝️

@codecov-io

This comment has been minimized.

@webknjaz webknjaz closed this Aug 29, 2019
@webknjaz webknjaz reopened this Aug 29, 2019
@ojii ojii requested a review from webknjaz as a code owner August 29, 2019 10:33
@psf-chronographer psf-chronographer bot added the bot:chronographer:provided There is a change note present in this PR label Aug 29, 2019
@webknjaz

This comment has been minimized.

@ojii ojii force-pushed the resolve-host-race-conditions branch from ccfc90a to e44fe14 Compare August 29, 2019 10:37
Copy link
Member

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

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

LGTM.
The PR should be backported to 3.6 branch on merging

@webknjaz webknjaz removed their request for review August 29, 2019 20:06
@webknjaz
Copy link
Member

I won't review this PR, plz handle the merge/backport this w/o me.

@dimaqq
Copy link
Contributor

dimaqq commented Aug 30, 2019

👍
I wish the new tests made it clearer what was being tested, for example DummyTracer is hardly a good name for "tracer with a side effect that simulates another coro calling resolver which may change shared data", but I guess that's minor...

Copy link
Member

@asvetlov asvetlov left a comment

Choose a reason for hiding this comment

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

Comments can help to keep the (not very obvious) change after future edits

aiohttp/connector.py Show resolved Hide resolved
aiohttp/connector.py Show resolved Hide resolved
aiohttp/connector.py Show resolved Hide resolved
ojii and others added 3 commits August 30, 2019 19:21
Co-Authored-By: Andrew Svetlov <[email protected]>
Co-Authored-By: Andrew Svetlov <[email protected]>
Co-Authored-By: Andrew Svetlov <[email protected]>
@asvetlov
Copy link
Member

asvetlov commented Aug 30, 2019

Regarding @dimaqq note I can live with the current naming but if you guys want to use more meaningful names -- you are welcome.

@asvetlov asvetlov merged commit 010caab into aio-libs:master Aug 31, 2019
asvetlov pushed a commit that referenced this pull request Aug 31, 2019
(cherry picked from commit 010caab)

Co-authored-by: Jonas Obrist <[email protected]>
@asvetlov
Copy link
Member

Thanks!

asvetlov added a commit that referenced this pull request Aug 31, 2019
(cherry picked from commit 010caab)

Co-authored-by: Jonas Obrist <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot:chronographer:provided There is a change note present in this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Potential cache/throttle race conditions in Connector._resolve_host with traces
5 participants