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

Make Shutdown blocking to ensure outstanding requests completion #92

Merged
merged 6 commits into from
Nov 12, 2023

Conversation

pin
Copy link
Owner

@pin pin commented Oct 28, 2023

Main change is in server Shutdown method semantics: upon call Serve (or LintenAndServe will exit immediately but Shutdown will block until all outstanding transfers are completed or timed out.

Hopefully it is effectively unnoticeable change for downstream code, but allows more straight-forward code, when Serve called in goroutine as e.g.:

go s.Serve(conn)

This become similar to Golang HTTP server shutdown logic.

Fixes #87

TestHookSuccess runs one request and check that hook was called. That test its flaky because server exits before goroutine executes a hook.

This change makes Shutdown blocking so when it completes the server is stopped all operations.

@pin pin mentioned this pull request Oct 28, 2023
@pin pin merged commit 71d1b5e into master Nov 12, 2023
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.

Debian build failures
1 participant