]> Cypherpunks repositories - gostls13.git/commit
net: coalesce duplicate in-flight DNS lookups
authorBrad Fitzpatrick <bradfitz@golang.org>
Fri, 14 Jun 2013 15:59:43 +0000 (08:59 -0700)
committerBrad Fitzpatrick <bradfitz@golang.org>
Fri, 14 Jun 2013 15:59:43 +0000 (08:59 -0700)
commit61d3b2db6292581fc07a3767ec23ec94ad6100d1
treeaa0df796f1f0b41e0841e57f2c9c463bc74af47b
parent3be794cdc2c7fc78a43b6a619ddf281b7271b520
net: coalesce duplicate in-flight DNS lookups

In Issue 5625, Russ says: "We should at least have a cache of
inflight lookups, so that 100 simultaneous dials of one host
name don't do the work 100x. That's easy and (assume we forget
the answer once they all get it) doesn't pose any consistency
problems. It just merges simultaneous work."

This brings in singleflight (unexported) from Google /
Camlistore, but without its tests. Maybe we should put it
somewhere in the standard library. But not now.

Update #5625

R=golang-dev, iant, cespare, rsc, dave, rogpeppe, remyoudompheng
CC=golang-dev
https://golang.org/cl/10079043
src/pkg/net/lookup.go
src/pkg/net/singleflight.go [new file with mode: 0644]