[cmd/opampsupervisor] Errors during bootstrapping will fail to shut down collector #31943
Closed
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)
Solution would be to use defer
statements to ensure the command is always stopped before returning from the getBootstrapInfo
method.
Collector version
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