-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[exporter/stefexporter] Fix a context cancellation bug in STEF export…
…er (#37944) #### Description STEF exporter used context that was passed to exportMetrics() as the context for the entire gRPC stream. This was wrong since the context is cancelled immediately after exportMetrics returns. The exporter now uses a separate context for the gRPC stream. This context has a longer duration, matching the duration of the gRPC stream. The context passed to exportMetrics() continues to be used as the context for connection attempt. If connection is not established within the limits of that context then the attempt to connect is correctly aborted. This now correctly decouples the context (and cancellation) for connection attempt from the context of the connected gRPC stream. #### Testing Added unit tests to verify the bug fix.
- Loading branch information
1 parent
3fea1c2
commit d983217
Showing
2 changed files
with
164 additions
and
1 deletion.
There are no files selected for viewing
This file contains 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
This file contains 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