Skip to content
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

ignore ENOTCONN error during closing state of Connection #653

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

flumm
Copy link

@flumm flumm commented Dec 6, 2022

If the underlying socket is already closed during State::Closing, it is not an error to get ENOTCONN when calling shutdown, so ignore it.

This can happen when a connection is local to the host and the kernel already has shutdown the socket.

related to hyperium/hyper#3070
(with this change, i can't reproduce the behaviour there anymore)

not completely sure about also checking reason for NO_ERROR, maybe should also check intiator for Library ?

IMO this change is ok, because AFAICS this only happens when we come from handle_poll2_result where it's already noted that we're 'already going away' and it does not make sense to bubble a ENOTCONN up when trying to shutdown the connection as it's already shut down.

If the underlying socket is already closed during State::Closing,
it is not an error to get `ENOTCONN` when calling shutdown, so ignore it.

This can happen when a connection is local to the host and the kernel
already has shutdown the socket.

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant