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

server: Ignore net.ErrClosed errors when shutting down #189

Merged
merged 1 commit into from
May 5, 2024

Conversation

Natolumin
Copy link
Member

Fixes #103

Also make server.Wait wait for all the listeners to exit, instead of returning when the first one closes, which we couldn't do before because of the spurious errors it would return - this ensures that the server is completely shut down when server.Wait returns, instead of potentially still having listeners answering their last requests.

errors.Join requires go 1.20, update go.mod accordingly. CI already runs on 1.20 and up only so doesn't need changes

Also make server.Wait wait for all the listeners to exit, instead of
returning when the first one closes, which we couldn't do before because
of the spurious errors it would return

errors.Join requires go 1.20, update go.mod

Fixes coredhcp#103

Signed-off-by: Anatole Denis <anatole@unverle.fr>
Copy link

codecov bot commented May 5, 2024

Codecov Report

Attention: Patch coverage is 18.18182% with 9 lines in your changes are missing coverage. Please review.

Project coverage is 42.62%. Comparing base (e3f7529) to head (e42ef6b).

Files Patch % Lines
server/handle.go 0.00% 4 Missing and 2 partials ⚠️
server/serve.go 40.00% 2 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #189      +/-   ##
==========================================
- Coverage   42.84%   42.62%   -0.23%     
==========================================
  Files          24       24              
  Lines        1335     1342       +7     
==========================================
  Hits          572      572              
- Misses        674      679       +5     
- Partials       89       91       +2     
Flag Coverage Δ
integtests 23.47% <18.18%> (-0.21%) ⬇️
unittests 46.87% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@Natolumin Natolumin merged commit 28988eb into coredhcp:master May 5, 2024
11 of 13 checks passed
@Natolumin Natolumin deleted the closed-conn branch May 5, 2024 15:29
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.

"use of closed network connection" errror returned after Close() called
2 participants