-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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 OTLP receiver Shutdown() bug #2555
Fix OTLP receiver Shutdown() bug #2555
Conversation
3163ee0
to
30ca26c
Compare
30ca26c
to
96e9d25
Compare
Codecov Report
@@ Coverage Diff @@
## main #2555 +/- ##
==========================================
- Coverage 91.69% 91.64% -0.05%
==========================================
Files 267 268 +1
Lines 15107 15161 +54
==========================================
+ Hits 13852 13894 +42
- Misses 871 877 +6
- Partials 384 390 +6
Continue to review full report at Codecov.
|
OTLP receiver had a bug due to which it could generate data after Shutdown() was returned. It was visible in TestShutdown, with the following symptoms (it was a racy bug): === RUN TestShutdown otlp_test.go:871: Error Trace: otlp_test.go:871 Error: Not equal: expected: 4 actual : 5 Test: TestShutdown otlp_test.go:871: Error Trace: otlp_test.go:871 Error: Not equal: expected: 6 actual : 7 Test: TestShutdown --- FAIL: TestShutdown (0.49s) I added a Helper which allows to wait until all in-flight operations are complete before the Shutdown() function returns. The Helper can be used by other components too in the future.
96e9d25
to
1442692
Compare
I need a few pairs of fresh eye to verify the Helper implementation. |
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.
I think this is a much simpler fix #2564
return errTimeout | ||
case <-doneWaitingForProcessing: | ||
} | ||
return nil |
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 can be moved in the select
This is nice. I did not know there was already the graceful shutdown methods for servers. I will close this PR. |
Bumps [aquasecurity/trivy-action](https://github.com/aquasecurity/trivy-action) from 0.9.0 to 0.9.1. - [Release notes](https://github.com/aquasecurity/trivy-action/releases) - [Commits](aquasecurity/trivy-action@0.9.0...0.9.1) --- updated-dependencies: - dependency-name: aquasecurity/trivy-action dependency-type: direct:production update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <[email protected]> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
OTLP receiver had a bug due to which it could generate data after Shutdown()
was returned.
It was visible in TestShutdown, with the following symptoms (it was a racy bug):
I added a Helper which allows to wait until all in-flight operations are complete
before the Shutdown() function returns.
The Helper can be used by other components too in the future.