Fix flaky gRPC server instrumentation#1122
Merged
SylvainJuge merged 7 commits intoelastic:masterfrom Apr 6, 2020
Merged
Conversation
Closed
felixbarny
approved these changes
Apr 3, 2020
eyalkoren
reviewed
Apr 5, 2020
Codecov Report
@@ Coverage Diff @@
## master #1122 +/- ##
============================================
- Coverage 60.04% 59.76% -0.28%
Complexity 87 87
============================================
Files 327 327
Lines 14806 14867 +61
Branches 2071 2083 +12
============================================
- Hits 8890 8886 -4
- Misses 5318 5381 +63
- Partials 598 600 +2
Continue to review full report at Codecov.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What does this PR do?
A test was qualified as flaky, whereas in practice the implementation was the culprit.
gRPC server instrumentation was relying on the fact that transaction processing stayed on the same thread. However, even if it is the case most of the time, it is not an absolute truth and produces random failures.
Thus, I've reworked gRPC server instrumentation to store in-flight transaction within helper class in-memory storage (a hash-map), in a similar way as it was done for client instrumentation.
Checklist
I have made corresponding changes to the documentationI have added tests that prove my fix is effective or that my feature worksI have updated supported-technologies.asciidocAdded an API method or config option? Document in which version this will be introducedAdded an instrumentation plugin? How did you make sure that old, non-supported versions are not instrumented by accident?Author's Checklist
Related issues