Skip to content

Conversation

@pete911
Copy link

@pete911 pete911 commented Dec 11, 2025

Description of the issue

Describe the problem or feature in addition to a link to the issues.

Description of changes

server.Close only closes connections and does not wait for server shutdown. We can see this behaviour in the logs:

failed to serve and listen","error":"listen tcp :4311: bind: address already in use
failed to serve and listen","error":"http: Server closed"
failed to serve and listen","error":"http: Server closed"
failed to serve and listen","error":"http: Server closed"

http: Server closed error is coming from ListenAndServeTLS (s.shuttingDown() check, this means that the server is not shut down. After multiple tries, we get error from net.Listen. By using Shutdown(...) instead of Close(), the code is going to wait for server shutdown, not just for connections to be closed.

License

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.

Tests

Existing tests were re-run and are working. This change does not introduce any new behaviour.

Requirements

Before commiting your code, please do the following steps.

  1. Run make fmt and make fmt-sh
  2. Run make lint

Integration Tests

To run integration tests against this PR, add the ready for testing label.

@pete911 pete911 requested a review from a team as a code owner December 11, 2025 17:08
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.

1 participant