Skip to content

close can fail on FreeBSD with ECONNRESET #786

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
talex5 opened this issue Nov 29, 2024 · 0 comments · Fixed by #787
Closed

close can fail on FreeBSD with ECONNRESET #786

talex5 opened this issue Nov 29, 2024 · 0 comments · Fixed by #787
Labels
bug Something isn't working

Comments

@talex5
Copy link
Collaborator

talex5 commented Nov 29, 2024

On FreeBSD, closing a socket can return ECONNRESET. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=159179 and python/cpython#2565.

Eio should ignore this error automatically. This is how Python handles it:

https://github.com/python/cpython/blob/15d6506d175780bb29e5fcde654e3860408aa93e/Modules/socketmodule.c#L6215-L6218

https://man.freebsd.org/cgi/man.cgi?query=close&sektion=2 says:

In case of any error except EBADF, the supplied file descriptor is deallocated and therefore is no longer valid.

@talex5 talex5 added the bug Something isn't working label Nov 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant