You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Attached is a file that demonstrates this issue. To run it, just run;
6g closebug2.go && 6l closebug2.6 && ./6.out
This starts a server (listener.Accept() in a loop), and then closes the listener after
one second. However, it
still accepts one more connection (you can see this by running telnet localhost 9999).
Only after that connection is processed is the listener closed.
What steps will reproduce the problem?
1. Call listener.Accept in a loop (this blocks)
2. On a separate goroutine, call listener.Close()
3. the listener will not close until another connection is accepted
What is the expected output?
The listener will close immediately
What do you see instead?
The listener waits until another connection has been accepted, then closes
Which compiler are you using (5g, 6g, 8g, gccgo)?
6g
Which operating system are you using?
osx
Which revision are you using? (hg identify)
51c777dbccb9+ release/release.2010-12-22
Please provide any additional information below.
The problem seems to be in net/fd.go
Both fd.Close() and fd.Accept() call fd.incref(), which acquires a lock. It seems that
the lock is held by Accept(), and only when it is released is Close() called.
Should there be a special condition that handles this?
The text was updated successfully, but these errors were encountered:
The text was updated successfully, but these errors were encountered: