mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 11:15:54 +03:00
[GH-ISSUE #2169] Handle sockets that have been shut down #909
Labels
No labels
blocked
breaking-change
bug
bug:critical
bug:tests
cleanup
compliance
compliance
compliance
crate:all
crate:client
crate:native-tls
crate:proto
crate:recursor
crate:resolver
crate:resolver
crate:rustls
crate:server
crate:util
dependencies
docs
duplicate
easy
easy
enhance
enhance
enhance
feature:dns-over-https
feature:dns-over-quic
feature:dns-over-tls
feature:dnsssec
feature:global_lb
feature:mdns
feature:tsig
features:edns
has workaround
ops
perf
platform:WASM
platform:android
platform:fuchsia
platform:linux
platform:macos
platform:windows
pull-request
question
test
tools
tools
trust
unclear
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/hickory-dns#909
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dlon on GitHub (Mar 9, 2024).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/2169
Describe the bug
This error is logged indefinitely after a socket used by a
ServerFuturehas been shut down:[WARN] error receiving message on udp_socket: Socket is not connected (os error 57).To Reproduce
Create a new
ServerFutureand register a UDP socket usingServerFuture::register_listener. Callpid_shutdown_sockets()to shut down all sockets owned by the server process.Expected behavior
The server should stop trying to receive data and return an error. Alternatively, the socket should be replaced.
System:
Version:
Crate: server
Version: 0.23.0
@djc commented on GitHub (Mar 9, 2024):
Why are closing all of the process sockets like that? What is the purpose of doing so?
@dlon commented on GitHub (Mar 9, 2024):
I've seen sockets being closed/shutdown randomly on a few machines, but I can't tell you why. It might be something that the OS is doing. Regardless, it probably makes no sense to continue to receive/send on them, right?
@bluejekyll commented on GitHub (Mar 9, 2024):
Seems like we should be treating this error differently, but, if the server socket is closing, that would imply the server can no longer be used. It would need to reopen the Socket. What is closing the socket?
To be clear, the socket registered as part of "register_listener" should be live as long as the server itself and never be closed until the server is shutdown.
@dlon commented on GitHub (Mar 11, 2024):
Would it make sense to simply break in the case where
ENOTCONNis returned here? (This probably needs to be handled for the non-UDP cases as well.)I suspect that this issue might occur when the process is suspended under some circumstances. Can't tell you what they are since I haven't been able to reproduce this myself, so I'm just speculating.
Arguably, this case should be handled regardless, since any process (running as root) can call
pid_shutdown_socketsto close the sockets. There's no way to gracefully handle this at the moment.@djc commented on GitHub (Mar 11, 2024):
Yes, breaking out of the loop for that scenario seems reasonable. Would you be able to send a PR for that?