diff options
author | Yury Selivanov <yselivanov@sprymix.com> | 2015-12-17 00:31:17 (GMT) |
---|---|---|
committer | Yury Selivanov <yselivanov@sprymix.com> | 2015-12-17 00:31:17 (GMT) |
commit | d5c2a6210026834eb3cb7165e470d2cbc3065db8 (patch) | |
tree | 27996fb066b690bde43694bdfd6b50deaed8f630 /Lib/test/test_asyncio/test_events.py | |
parent | 8c084eb77d69ec1527fad943a4031b1b29193e98 (diff) | |
download | cpython-d5c2a6210026834eb3cb7165e470d2cbc3065db8.zip cpython-d5c2a6210026834eb3cb7165e470d2cbc3065db8.tar.gz cpython-d5c2a6210026834eb3cb7165e470d2cbc3065db8.tar.bz2 |
asyncio: Skip getaddrinfo if host is already resolved.
getaddrinfo takes an exclusive lock on some platforms, causing clients to queue
up waiting for the lock if many names are being resolved concurrently. Users
may want to handle name resolution in their own code, for the sake of caching,
using an alternate resolver, or to measure DNS duration separately from
connection duration. Skip getaddrinfo if the "host" passed into
create_connection is already resolved.
See https://github.com/python/asyncio/pull/302 for details.
Patch by A. Jesse Jiryu Davis.
Diffstat (limited to 'Lib/test/test_asyncio/test_events.py')
-rw-r--r-- | Lib/test/test_asyncio/test_events.py | 4 |
1 files changed, 0 insertions, 4 deletions
diff --git a/Lib/test/test_asyncio/test_events.py b/Lib/test/test_asyncio/test_events.py index 141fde7..f174604 100644 --- a/Lib/test/test_asyncio/test_events.py +++ b/Lib/test/test_asyncio/test_events.py @@ -1573,10 +1573,6 @@ class EventLoopTestsMixin: 'selector': self.loop._selector.__class__.__name__}) def test_sock_connect_address(self): - # In debug mode, sock_connect() must ensure that the address is already - # resolved (call _check_resolved_address()) - self.loop.set_debug(True) - addresses = [(socket.AF_INET, ('www.python.org', 80))] if support.IPV6_ENABLED: addresses.extend(( |