Description
Hi,
I'm trying to resolve timeouts occurring on aix/ppc64 with net.TestNotTemporaryRead
.
https://build.golang.org/log/45540cc03c1d37057e8f725d7f2dd431652ddf4c
https://build.golang.org/log/37d60c3b3cd46cf39d118f84e695049d390da40e
...
This timeout occurs because Accept()
seems to be stuck in a infinite loop if the server is already closed. It's only a guess because I can't trigger the bug manually on my local machine. However, a similar behaviorr can be easily made with: https://play.golang.org/p/0IXrHf87i-2.
It does work on linux/amd64
but it times out on aix/ppc64
. This might not be the root of this bug but a possible workaround can be to increase the delay on the server.
However, I've several questions:
- Why is the client doing
Accept()
and the server doingDial()
? Is it supposed to be the opposite or it doesn't matter ? This is the case for some others tests of net_test.go. - What behavior Go is expected when an
accept()
is made when the server is already closed (but the port is still listened) ?
Should it succeed or not ? On aix/ppc64, accept syscall returns EAGAIN (because of O_NONBLOCK flag) and on linux/amd64 it does succeed.
I've also discovered that the behavior of connect
is slightly different on AIX than on Linux (I don't know about others OSes). I've tried with the following C code (taken from #6828): accept_after_connect.c.txt. The first connect
doesn't return EINPROGRESS as on Linux. It doesn't seem a bug as a connection can result from the listen
syscall.
Does Go want EINPROGRESS to be returned ? (*netFD).connect will wait with netpoll if it is.