You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The problem is that during shutdown the otelcol no longer looks for updates on the asyncErrorChannel, and if any component will try to write to that channel will get into a deadlock.
func (r*receiver) Start(_ context.Context, _ component.Host) error {
r.server:=&http.Server{
Addr: ":8080",
Handler: myHandler,
}
gofunc() {
iferr:=r.server.ListenAndServe(); err!=nil {
// This is a small bug since err == http.ErrServerClosed is expected.r.settings.ReportStatus(component.NewFatalErrorEvent(err))
}
}()
returnnil
}
func (r*receiver) Shutdown(context.Context) error {
ifr.server==nil {
returnnil
}
returnr.server.Close()
}
The text was updated successfully, but these errors were encountered:
**Description:** <Describe what has changed.>
<!--Ex. Fixing a bug - Describe the bug and how this fixes the issue.
Ex. Adding a feature - Explain what this achieves.-->
The kafka receiver's shutdown method is to cancel the context of a
running sub goroutine. However, a small bug was causing a fatal error to
be reported during shutdown when this expected condition was hit. The
fatal error being reported during shutdown was causing another bug to be
hit,
open-telemetry/opentelemetry-collector#9824.
This fix means that shutdown won't be blocked in expected shutdown
conditions, but the `core` bug referenced above means shutdown will
still be block in unexpected error situations.
This fix is being taken from a comment made by @Dennis8274 on the issue.
**Link to tracking Issue:** <Issue number if applicable>
Fixes#30789
**Testing:** <Describe what testing was performed and which tests were
added.>
Stepped through `TestTracesReceiverStart` in a debugger before the
change to see the fatal status being reported. It was no longer reported
after applying the fix. Manually tested running the collector with a
kafka receiver and saw that before the fix it was indeed being blocked
on a normal shutdown, but after the fix it shutdown as expected.
The problem is that during shutdown the otelcol no longer looks for updates on the
asyncErrorChannel
, and if any component will try to write to that channel will get into a deadlock.The text was updated successfully, but these errors were encountered: