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

Graceful shutdown of ServerFuture #1976

Closed
nmittler opened this issue Jun 22, 2023 · 4 comments · Fixed by #1977
Closed

Graceful shutdown of ServerFuture #1976

nmittler opened this issue Jun 22, 2023 · 4 comments · Fixed by #1977

Comments

@nmittler
Copy link
Contributor

Is your feature request related to a problem? Please describe.
When running a DNS server (via ServerFuture) as part of a larger application, it's desirable to include the shutdown of the DNS server as part of the shutdown workflow for the process.

Describe the solution you'd like
Ideally, the DNS server would support hooks to initiate a graceful shutdown, as well as notifying the application when the server shutdown has completed. During a graceful shutdown, the server would finish serving existing requests, but reject new requests.

Describe alternatives you've considered
NA

Additional context
This came up in an Istio PR, which adds a Trust-DNS-based proxy: istio/ztunnel#536 (comment)

@djc
Copy link
Collaborator

djc commented Jun 25, 2023

Sounds good to me to add something like this. Maybe look at how hyper models Server::with_graceful_shutdown()?

@nmittler
Copy link
Contributor Author

Sounds good, I'll take a look. I've already started some hacking using the linkerd drain crate, since that's what Istio is using currently. I'll compare and see what works best for ServerFuture.

nmittler added a commit to nmittler/trust-dns that referenced this issue Jun 25, 2023
This adds a dependency on [Linkerd drain](https://github.com/linkerd/drain-rs), which is used to allow the application to gracefully shutdown the DNS server.

Fixes hickory-dns#1976.
nmittler added a commit to nmittler/trust-dns that referenced this issue Jun 27, 2023
Creating a `Server` object with a new interface to handle the various types of servers and their shutdown.

Fixes hickory-dns#1976.
nmittler added a commit to nmittler/trust-dns that referenced this issue Jun 27, 2023
Creating a `Server` object with a new interface to handle the various types of servers and their shutdown.

Fixes hickory-dns#1976.
nmittler added a commit to nmittler/trust-dns that referenced this issue Jun 28, 2023
Creating a `Server` object with a new interface to handle the various types of servers and their shutdown.

Fixes hickory-dns#1976.
@blaine
Copy link

blaine commented Jun 28, 2023

This is extremely apropos for us! Will be watching this, let us know if we can help. cc @zeeshanlakhani

nmittler added a commit to nmittler/trust-dns that referenced this issue Jun 29, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jun 29, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jun 29, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jun 30, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jun 30, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jun 30, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jun 30, 2023
@nmittler
Copy link
Contributor Author

nmittler commented Jul 1, 2023

@blaine @zeeshanlakhani FYI #1977 is out for review if you're interested

nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 7, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 9, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 9, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 9, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 9, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 9, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 10, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 10, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 10, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 10, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 29, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 30, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 30, 2023
nmittler added a commit to nmittler/trust-dns that referenced this issue Jul 30, 2023
bluejekyll pushed a commit that referenced this issue Aug 1, 2023
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 a pull request may close this issue.

3 participants