Skip to content

[cmd/opampsupervisor] Errors during bootstrapping will fail to shut down collector #31943

Closed
@BinaryFissionGames

Description

Component(s)

cmd/opampsupervisor

What happened?

Description

If collector bootstrapping fails, the Stop method will not be called for the collector command. This causes the collector to outlive the supervisor, which ends up blocking any attempts for the supervisor to start up again (collector occupies port 8888)

if err = cmd.Stop(context.Background()); err != nil {

Solution would be to use defer statements to ensure the command is always stopped before returning from the getBootstrapInfo method.

Collector version

f8627a7

Environment information

Environment

OS: macos
Compiler(if manually compiled): go 1.22

OpenTelemetry Collector configuration

No response

Log output

No response

Additional context

No response

Metadata

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions