Skip to content

[fileexporter] nil pointer dereference during collector shutdown #46871

@overmeulen

Description

@overmeulen

Component(s)

exporter/file

What happened?

Description

When the collector shuts down I randomly get a panic runtime error

Steps to Reproduce

Hard to reproduce as it is a race condition during the collector shut down

Expected Result

No errors

Actual Result

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x148f906]
goroutine 160 [running]:
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter.(*fileWriter).export(...)
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter@v0.123.0/file_writer.go:54
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter.(*fileExporter).consumeMetrics(0xc000b44138, {0xc0003da0e0?, 0x0?}, {0xc0015ba330?, 0xc0014b2e08?})
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter@v0.123.0/file_exporter.go:36 +0x46

Collector version

0.123.0

Environment information

OpenTelemetry Collector configuration

Log output

panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x28 pc=0x148f906]
goroutine 160 [running]:
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter.(*fileWriter).export(...)
    github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter@v0.123.0/file_writer.go:54
github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter.(*fileExporter).consumeMetrics(0xc000b44138, {0xc0003da0e0?, 0x0?}, {0xc0015ba330?, 0xc0014b2e08?})
    github.com/open-telemetry/opentelemetry-collector-contrib/exporter/fileexporter@v0.123.0/file_exporter.go:36 +0x46

Additional context

No response

Tip

React with 👍 to help prioritize this issue. Please use comments to provide useful context, avoiding +1 or me too, to help us triage it. Learn more here.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions