open-telemetry / opentelemetry-collector-contrib

Contrib repository for the OpenTelemetry Collector
https://opentelemetry.io
Apache License 2.0
3.04k stars 2.35k forks source link

[processor/logstransform]: Long running tasks uses the wrong context #31140

Open BinaryFissionGames opened 8 months ago

BinaryFissionGames commented 8 months ago

Component(s)

processor/logstransform

Describe the issue you're reporting

The context passed in from Start should not be used for long-running operations; See the comment from the upstream collector:

// If the component needs to perform a long-running starting operation then it is recommended
// that Start() returns quickly and the long-running operation is performed in background.
// In that case make sure that the long-running operation does not use the context passed
// to Start() function since that context will be cancelled soon and can abort the long-running
// operation. Create a new context from the context.Background() for long-running operations.

https://github.com/open-telemetry/opentelemetry-collector/blob/9553bfeb936232fec9ff805ab763142880b391b6/component/component.go#L39-L44

This doesn't seem to actually lead to any negative effects, but it does seem that the logstransformprocessor is using the context passed in from start for long-running goroutines.

github-actions[bot] commented 8 months ago

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.

github-actions[bot] commented 6 months ago

This issue has been inactive for 60 days. It will be closed in 60 days if there is no activity. To ping code owners by adding a component label, see Adding Labels via Comments, or if you are unsure of which component this issue relates to, please ping @open-telemetry/collector-contrib-triagers. If this issue is still relevant, please ping the code owners or leave a comment explaining why it is still relevant. Otherwise, please close it.

Pinging code owners:

See Adding Labels via Comments if you do not have permissions to add labels yourself.