• Grégoire Delattre's avatar
    net: make concurrent resolver lookups independent · 63a4acba
    Grégoire Delattre authored
    The current resolver uses a global lookupGroup which merges LookupIPAddr
    calls together for lookups for the same hostname if used concurrently.
    As a result only one of the resolvers is actually used to perform the
    DNS lookup but the result is shared by all the resolvers.
    
    This commit limits the scope of the lookupGroup to the resolver itself
    allowing each resolver to make its own requests without sharing the
    result with other resolvers.
    
    Fixes #22908
    
    Change-Id: Ibba896eebb05e59f18ce4132564ea1f2b4b6c6d9
    Reviewed-on: https://go-review.googlesource.com/80775
    Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
    TryBot-Result: Gobot Gobot <gobot@golang.org>
    Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
    63a4acba
lookup.go 13.6 KB