-
Notifications
You must be signed in to change notification settings - Fork 80
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
fix: wait for HTTP server serve() termination #348
base: main
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #348 +/- ##
==========================================
- Coverage 78.29% 78.22% -0.07%
==========================================
Files 25 25
Lines 2386 2402 +16
==========================================
+ Hits 1868 1879 +11
- Misses 410 414 +4
- Partials 108 109 +1 ☔ View full report in Codecov by Sentry. |
server/serverimpl.go
Outdated
if err != nil { | ||
return err | ||
} | ||
s.httpServerServeWg.Wait() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This needs to honour ctx
cancellation. If context is Done(), Stop() needs to return with an error. I am not sure if this is going to be the behavior, given that Wait() can wait indefinitely long. Please add a test that verifies the cancellation case.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Makes sense to me, added in 4e4986f
Please update doc-comment of OpAMPServer.Stop() to explain that it waits until the server socket is released. |
looks like there is an unrelated flaky test on the examples: |
related data race issue #256 |
372361f
to
4e4986f
Compare
Fixes #347