mirror of
https://github.com/hickory-dns/hickory-dns.git
synced 2026-04-25 03:05:51 +03:00
[GH-ISSUE #1869] Graceful Shutdown of Server #802
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#802
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 @theduke on GitHub (Dec 28, 2022).
Original GitHub issue: https://github.com/hickory-dns/hickory-dns/issues/1869
Am I missing a way to do orderly shutdown of the server?
As in: a way to stop the server from accepting new connections, finish the running requests and then resolve the
ServerFuture.?@djc commented on GitHub (Dec 30, 2022):
Yup, it looks like there's currently no way to do that. Would you be able to submit a PR to fix that?
@bluejekyll commented on GitHub (Dec 30, 2022):
Yeah, this hasn't been implemented yet. I've had an old issue from the beginning of the project to implement something else for this as well for doing a config reload on a SIGHUP, #20.
I think this issue could be good for library support, while the SIGHUP would be specific to the
trust-dnsbinary. The way I see it is we need a couple of things to be implemented. Internally the server needs to have a shared atomic for triggering the safe shutdown. This would then be wired into all the loops on all the listening sockets to shut down those listeners. The challenge that we'd need a good solution for is to make sure those listening loops are woken even if no new connections come in. I don't know how else to trigger that. There may be some features in Tokio or Futures that I'm unfamiliar with that make that easy.@djc commented on GitHub (Dec 30, 2022):
Could probably do a
tokio::select!()against the listener on one side and a sync primitive like atokio::sync::Notifyon the other side?@bluejekyll commented on GitHub (Dec 31, 2022):
Yes; Notify is probably a good option to do that.
@yerke commented on GitHub (Aug 9, 2023):
I think this issue was solved in https://github.com/bluejekyll/trust-dns/pull/1977