[receiver/azureeventhub] Close storage extension client during component shutdown#36296
Merged
djaglowski merged 5 commits intoDec 2, 2024
Merged
Conversation
atoulme
reviewed
Nov 12, 2024
Contributor
|
Sorry, this needs tests :/ |
Contributor
Author
|
@atoulme any chance you have a brief moment to re-review this PR in the near future? |
djaglowski
approved these changes
Dec 2, 2024
| if err != nil { | ||
| h.settings.Logger.Debug("Error connecting to Storage", zap.Error(err)) | ||
| return err | ||
| if h.storageClient == nil { // set manually for testing. |
Member
There was a problem hiding this comment.
I'm not going to block this PR since it fixes an important bug, but generally I'm not a fan of tests relying on special access to the internals of the code. A better way to do this would be to mock the host, so that it returns the mock client.
shivanthzen
pushed a commit
to shivanthzen/opentelemetry-collector-contrib
that referenced
this pull request
Dec 5, 2024
…ent shutdown (open-telemetry#36296) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description When using a storage extension, the component will call Close on the client during component shutdown. This fixes a bug that resulted in a file potentially remaining locked after component shutdown. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue open-telemetry#36238 <!--Describe what testing was performed and which tests were added.--> #### Testing Since reproducing this was described in the issue as "difficult without custom code", testing just involved ensuring that unit tests covered the added code and ran successfully, and manually ensuring that the collector could still receive events from AEH.
ZenoCC-Peng
pushed a commit
to ZenoCC-Peng/opentelemetry-collector-contrib
that referenced
this pull request
Dec 6, 2024
…ent shutdown (open-telemetry#36296) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description When using a storage extension, the component will call Close on the client during component shutdown. This fixes a bug that resulted in a file potentially remaining locked after component shutdown. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue open-telemetry#36238 <!--Describe what testing was performed and which tests were added.--> #### Testing Since reproducing this was described in the issue as "difficult without custom code", testing just involved ensuring that unit tests covered the added code and ran successfully, and manually ensuring that the collector could still receive events from AEH.
sbylica-splunk
pushed a commit
to sbylica-splunk/opentelemetry-collector-contrib
that referenced
this pull request
Dec 17, 2024
…ent shutdown (open-telemetry#36296) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description When using a storage extension, the component will call Close on the client during component shutdown. This fixes a bug that resulted in a file potentially remaining locked after component shutdown. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue open-telemetry#36238 <!--Describe what testing was performed and which tests were added.--> #### Testing Since reproducing this was described in the issue as "difficult without custom code", testing just involved ensuring that unit tests covered the added code and ran successfully, and manually ensuring that the collector could still receive events from AEH.
AkhigbeEromo
pushed a commit
to sematext/opentelemetry-collector-contrib
that referenced
this pull request
Jan 13, 2025
…ent shutdown (open-telemetry#36296) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description When using a storage extension, the component will call Close on the client during component shutdown. This fixes a bug that resulted in a file potentially remaining locked after component shutdown. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue open-telemetry#36238 <!--Describe what testing was performed and which tests were added.--> #### Testing Since reproducing this was described in the issue as "difficult without custom code", testing just involved ensuring that unit tests covered the added code and ran successfully, and manually ensuring that the collector could still receive events from AEH.
chengchuanpeng
pushed a commit
to chengchuanpeng/opentelemetry-collector-contrib
that referenced
this pull request
Jan 26, 2025
…ent shutdown (open-telemetry#36296) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description When using a storage extension, the component will call Close on the client during component shutdown. This fixes a bug that resulted in a file potentially remaining locked after component shutdown. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue open-telemetry#36238 <!--Describe what testing was performed and which tests were added.--> #### Testing Since reproducing this was described in the issue as "difficult without custom code", testing just involved ensuring that unit tests covered the added code and ran successfully, and manually ensuring that the collector could still receive events from AEH.
zeck-ops
pushed a commit
to zeck-ops/opentelemetry-collector-contrib
that referenced
this pull request
Apr 23, 2025
…ent shutdown (open-telemetry#36296) <!--Ex. Fixing a bug - Describe the bug and how this fixes the issue. Ex. Adding a feature - Explain what this achieves.--> #### Description When using a storage extension, the component will call Close on the client during component shutdown. This fixes a bug that resulted in a file potentially remaining locked after component shutdown. <!-- Issue number (e.g. open-telemetry#1234) or full URL to issue, if applicable. --> #### Link to tracking issue open-telemetry#36238 <!--Describe what testing was performed and which tests were added.--> #### Testing Since reproducing this was described in the issue as "difficult without custom code", testing just involved ensuring that unit tests covered the added code and ran successfully, and manually ensuring that the collector could still receive events from AEH.
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.
Description
When using a storage extension, the component will call Close on the client during component shutdown. This fixes a bug that resulted in a file potentially remaining locked after component shutdown.
Link to tracking issue
#36238
Testing
Since reproducing this was described in the issue as "difficult without custom code", testing just involved ensuring that unit tests covered the added code and ran successfully, and manually ensuring that the collector could still receive events from AEH.