Skip to content

fix example in graceful-shutdown.md: add drop(listener) #148

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

Merged
merged 1 commit into from
Apr 29, 2025

Conversation

fokx
Copy link
Contributor

@fokx fokx commented Apr 29, 2025

Need to drop the listener for the graceful shutdown to fully succeed. Otherwise, even though we cannot curl the server addr, netstat still shows the process listening. This will align the example with the hyper-util example in: https://github.com/hyperium/hyper-util/blob/e74ab7888638e768de17c47ed5f20c8b623a308f/examples/server_graceful.rs#L47

Need to drop the listener for the graceful shutdown to fully succeed. Otherwise, even though we cannot `curl` the server addr, `netstat` still shows the process listening. This will align the example with the hyper-util example in:
https://github.com/hyperium/hyper-util/blob/e74ab7888638e768de17c47ed5f20c8b623a308f/examples/server_graceful.rs#L47
Copy link
Member

@seanmonstar seanmonstar left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good catch, thanks!

@seanmonstar seanmonstar merged commit f65072a into hyperium:master Apr 29, 2025
3 checks passed
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.

2 participants