1
0
mirror of https://github.com/golang/go synced 2024-11-20 03:34:40 -07:00
go/src/internal
Ian Lance Taylor 23aad448b1 runtime: for kqueue treat EVFILT_READ with EV_EOF as permitting a write
On systems that use kqueue, we always register descriptors for both
EVFILT_READ and EVFILT_WRITE. On at least FreeBSD and OpenBSD, when
the write end of a pipe is registered for EVFILT_READ and EVFILT_WRITE
events, and the read end of the pipe is closed, kqueue reports an
EVFILT_READ event with EV_EOF set, but does not report an EVFILT_WRITE
event. Since the write to the pipe is waiting for an EVFILT_WRITE
event, closing the read end of a pipe can cause the write end to hang
rather than attempt another write which will fail with EPIPE.

Fix this by treating EVFILT_READ with EV_EOF set as making both reads
and writes ready to proceed.

The real test for this is in CL 71770, which tests using various
timeouts with pipes.

Updates #22114

Change-Id: Ib23fbaaddbccd8eee77bdf18f27a7f0aa50e2742
Reviewed-on: https://go-review.googlesource.com/71973
Reviewed-by: Matthew Dempsky <mdempsky@google.com>
2017-10-20 22:26:30 +00:00
..
cpu internal/cpu: add support for x86 FMA cpu feature detection 2017-09-11 05:20:01 +00:00
nettrace net, net/http: don't trace DNS dials 2016-05-14 00:14:25 +00:00
poll runtime: for kqueue treat EVFILT_READ with EV_EOF as permitting a write 2017-10-20 22:26:30 +00:00
race testing: mark tests and benchmarks failed if a race occurs during execution 2016-11-03 18:19:49 +00:00
singleflight all: make copyright headers consistent with one space after period 2016-03-01 23:34:33 +00:00
syscall path/filepath: re-implement windows EvalSymlinks 2017-10-05 04:16:00 +00:00
testenv internal/testenv: take testing.TB instead of *testing.T in MustHave* and SkipFlaky* 2017-09-19 23:34:28 +00:00
trace all: revert "all: prefer strings.LastIndexByte over strings.LastIndex" 2017-10-05 23:19:42 +00:00