You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to r...@golang.org, golan...@googlegroups.com
We chatted about also fixing the races in Read and Write. I've started
looking at that, but I think that it's a different patch. One needs to
add SHUT_* to syscall, edit os.File to expose it etc.
So I think this patch is self contained and should probably land with
its current scope. I'll do a follow up to fix the other race.
// TODO(rsc,agl): There is still a race in Read and Write,
// because they optimistically try to use the fd and don't
// call into the PollServer unless they get EAGAIN.
Previously a netFd could be queued for reading/writing in the channel,
but close(2)'ed before pollServer got to it. In this case, the kernel
would consider the descriptor closed and the attempt to add it to the
epoll set would fail and panic.
This patch makes Close a roundtrip to the pollServer, although the
actual close(2) still occurs elsewhere to avoid blocking the
pollServer.