• Yury Selivanov's avatar
    asyncio: Skip getaddrinfo if host is already resolved. · d5c2a621
    Yury Selivanov authored
    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.
    d5c2a621
test_events.py 91.5 KB