net: Conn.Close() does not error on double close on wasm #45423
Labels
arch-wasm
WebAssembly issues
NeedsInvestigation
Someone must examine and confirm this is a valid issue and not a duplicate of an existing one.
Milestone
Does this issue reproduce with the latest release?
Yes
What did you do?
Tried to write a test that checks whether a
net.Conn
is already closed by checking that callingClose
returns an error and run it on wasm. Seego/src/crypto/tls/handshake_server_test.go
Lines 1980 to 1982 in 5d5f779
What did you expect to see?
An error suggesting that the connection has already been closed, as is consistent with all other architectures tested.
What did you see instead?
No error.
Discussion
I think the offending code is here:
go/src/net/net_fake.go
Lines 110 to 115 in 5d5f779
On unix platforms the behaviour is to return
internal/poll.ErrNetClosing
orinternal/pool.ErrFileClosing
:go/src/internal/poll/fd_unix.go
Lines 93 to 96 in 5d5f779
go/src/internal/poll/fd.go
Lines 42 to 47 in 5d5f779
The text was updated successfully, but these errors were encountered: