1
0
mirror of https://github.com/golang/go synced 2024-09-30 14:28:33 -06:00
go/src
Ian Lance Taylor bf0f692202 net: handle spurious netpoll wakeups in connect
In some cases the netpoll code can cause a spurious wakeup. This is
normally harmless, as the woken up code simply retries the operation.
However, for connect, the test we were using to see whether the
connect had succeeded (setsockopt(SO_ERROR)) was not reliable in the
case of a spurious wakeup.  Change to using a reliable test (getpeername).
On Darwin we used a different technique: a second call to connect;
change Darwin to use getpeername as well.

Return the result of getpeername to avoid having to call it twice.

Fixes #19289.

Change-Id: I119ec8e7a41f482f1e590d4c65a37f6103fa22d9
Reviewed-on: https://go-review.googlesource.com/45815
Run-TryBot: Ian Lance Taylor <iant@golang.org>
TryBot-Result: Gobot Gobot <gobot@golang.org>
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2017-06-15 22:39:39 +00:00
..
archive archive/zip: set utf-8 flag 2017-05-26 17:08:18 +00:00
bufio all: single space after period 2017-06-09 20:29:09 +00:00
builtin builtin: use type aliases for rune and byte 2017-06-07 00:42:59 +00:00
bytes bytes: note that NewBuffer take ownership of its argument 2017-06-02 18:03:36 +00:00
cmd cmd/compile: fix crash in importer when running in debug mode 2017-06-15 22:27:53 +00:00
compress compress/lzw: don't follow code == hi if last is invalid. 2017-06-08 01:27:37 +00:00
container container/heap: avoid up() invoke if down() success at heap.Remove() 2017-05-13 19:10:24 +00:00
context context: define behavior for Err before Done is closed 2017-04-26 15:39:18 +00:00
crypto crypto/x509: support excluded domains in name constraints. 2017-06-13 18:33:29 +00:00
database/sql database/sql: ensure a Stmt from a Conn executes on the same driver.Conn 2017-06-13 19:16:54 +00:00
debug debug/dwarf: heuristically handle both UNIX and Windows paths 2017-05-26 14:35:20 +00:00
encoding encoding: report correct line numbers in tests 2017-06-15 16:11:28 +00:00
errors
expvar expvar: reduce sync.Map overhead for (*Map).Set 2017-05-02 17:13:40 +00:00
flag
fmt fmt: remove unnecessary trailing commas in doc.go 2017-06-07 21:00:42 +00:00
go go/token: use fine-grained locking in FileSet 2017-06-14 06:05:05 +00:00
hash internal/cpu: new package to detect cpu features 2017-05-10 17:02:21 +00:00
html html/template: only search identifier nodes for predefined escapers 2017-06-14 16:52:22 +00:00
image image/gif: don't panic on large or nil-containing color.Palettes. 2017-05-06 00:37:43 +00:00
index/suffixarray
internal internal/poll: implement RawControl of FD on Windows 2017-05-20 00:45:11 +00:00
io
log log/syslog: expand docs a bit to reduce confusion 2017-06-08 20:15:55 +00:00
math math: clarify comment about bit-identical results across architectures 2017-06-06 22:32:34 +00:00
mime mime/multipart: parse boundary with spaces properly 2017-05-23 22:56:44 +00:00
net net: handle spurious netpoll wakeups in connect 2017-06-15 22:39:39 +00:00
os os: clarify behavior of TempDir 2017-06-14 20:12:49 +00:00
path path/filepath: fix TestGlobError 2017-06-15 21:53:23 +00:00
plugin plugin: resolve plugin import path issue 2017-04-26 00:54:54 +00:00
reflect reflect: prevent structs with invalid field name 2017-06-13 21:51:17 +00:00
regexp regexp: speed up QuoteMeta with a lookup table 2017-04-28 06:43:14 +00:00
runtime runtime: enable GDB tests on mips64 (except TestGdbPythonCgo) 2017-06-15 15:52:05 +00:00
sort all: single space after period 2017-06-09 20:29:09 +00:00
strconv
strings strings: document Split{,N,After,AfterN} edge cases 2017-06-06 15:48:54 +00:00
sync sync: make another attempt at clarifying RWMutex double RLock rules 2017-06-14 18:31:34 +00:00
syscall runtime, syscall: reset signal handlers to default in child 2017-06-14 14:00:56 +00:00
testing testing: clarify -timeout flag 2017-06-15 05:57:29 +00:00
text all: single space after period 2017-06-09 20:29:09 +00:00
time time: remove some redundant equality comparison documentation 2017-06-14 22:00:50 +00:00
unicode unicode: move scripts from FoldCategories to FoldScripts 2017-06-15 01:05:31 +00:00
unsafe
vendor/golang_org/x vendor: update vendored lif 2017-05-29 21:54:12 +00:00
all.bash Revert "build: fail nicely if somebody runs all.bash from a binary tarball package" 2017-04-28 21:19:32 +00:00
all.bat
all.rc
androidtest.bash
bootstrap.bash
buildall.bash
clean.bash
clean.bat
clean.rc
cmp.bash
iostest.bash
make.bash
make.bat
Make.dist
make.rc
naclmake.bash
nacltest.bash
race.bash
race.bat
run.bash
run.bat
run.rc