ocaml-multicore / eio

Effects-based direct-style IO for multicore OCaml
Other
559 stars 72 forks source link

Should ignore ENOTCONN from shutdown? #521

Closed talex5 closed 1 year ago

talex5 commented 1 year ago

https://stackoverflow.com/questions/900042/what-causes-the-enotconn-error?noredirect=1#comment120088266_16008267 says:

As far as I can see, shutdown() on macOS may return ENOTCONN if the other side gracefully terminated connection (i.e. called shutdown(SHUT_RDWR) + close). Both sockets are TCP on 127.0.0.1. Not sure if this is conforming to POSIX, but this happens. The same code does not produce ENOTCONN on Linux.

We should probably get eio_posix to ignore this error on shutdown.

(from https://github.com/talex5/capnp-rpc/pull/2)

avsm commented 1 year ago

Agreed, I do keep running into this error leaking out with the Capnp eio port.

avsm commented 1 year ago

(Although, I do see it occasionally on Linux with the Eio_posix backend too)