Skip to content

Commit

Permalink
[receiver/awsecscontainermetricsreceiver] Fix possible sigsegv in shu…
Browse files Browse the repository at this point in the history
…tdown (open-telemetry#18736)

Fix possible sigsev error that could occur during shutdown if component was not correctly initialized.

Link to tracking Issue: Reported in ADOT downstream repository aws-observability/aws-otel-collector#982 (comment)
  • Loading branch information
bryan-aguilar authored Feb 21, 2023
1 parent 0ae1014 commit 31d48a5
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
16 changes: 16 additions & 0 deletions .chloggen/ecsCMshutdown.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# One of 'breaking', 'deprecation', 'new_component', 'enhancement', 'bug_fix'
change_type: bug_fix

# The name of the component, or a single word describing the area of concern, (e.g. filelogreceiver)
component: awsecscontainermetricsreceiver

# A brief description of the change. Surround your text with quotes ("") if it needs to start with a backtick (`).
note: Fix possible sig sev that could happen during component shutdown.

# One or more tracking issues related to the change
issues: [18736]

# (Optional) One or more lines of additional information to render under the primary note.
# These lines will be padded with 2 spaces and then inserted directly into the document.
# Use pipe (|) for multiline entries.
subtext:
4 changes: 3 additions & 1 deletion receiver/awsecscontainermetricsreceiver/receiver.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,9 @@ func (aecmr *awsEcsContainerMetricsReceiver) Start(ctx context.Context, host com

// Shutdown stops the awsecscontainermetricsreceiver receiver.
func (aecmr *awsEcsContainerMetricsReceiver) Shutdown(context.Context) error {
aecmr.cancel()
if aecmr.cancel != nil {
aecmr.cancel()
}
return nil
}

Expand Down

0 comments on commit 31d48a5

Please sign in to comment.