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

bug/gracefulShutdown #310

Merged
merged 3 commits into from
Sep 30, 2024
Merged

bug/gracefulShutdown #310

merged 3 commits into from
Sep 30, 2024

Conversation

Ujstor
Copy link
Collaborator

@Ujstor Ujstor commented Sep 28, 2024

By submitting this pull request, I confirm that my contribution is made under the terms of the MIT license.

Problem

ListenAndServe() method blocks the main goroutine, but when gracefulShutdown(server) is called in a separate goroutine, the Shutdown() function is triggered when an interrupt signal is received.

if the server.ListenAndServe() call does not return http.ErrServerClosed, it indicates that the server did not shut down properly, causing the main goroutine to keep running and preventing a clean exit

Checklist

Copy link
Contributor

@MitchellBerend MitchellBerend left a comment

Choose a reason for hiding this comment

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

LGTM!

Copy link
Contributor

@mdelapenya mdelapenya left a comment

Choose a reason for hiding this comment

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

LGTM!

@Ujstor Ujstor merged commit eb15b92 into Melkeydev:main Sep 30, 2024
159 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.

4 participants