Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
BinaryFissionGames opened this issue Mar 25, 2024 · 2 comments · Fixed by #31944
Closed
Assignees
Labels
bug Something isn't working cmd/opampsupervisor

Comments

@BinaryFissionGames
Copy link
Contributor

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

@BinaryFissionGames BinaryFissionGames added bug Something isn't working needs triage New item requiring triage labels Mar 25, 2024
Copy link
Contributor

Pinging code owners:

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

@crobert-1
Copy link
Member

I don't have very much experience with the area of the collector, but from your description and PR it makes sense to me. Thanks for filing and submitting a fix!

@crobert-1 crobert-1 removed the needs triage New item requiring triage label Mar 29, 2024
evan-bradley pushed a commit that referenced this issue Apr 16, 2024
… in bootstrapping (#31944)

**Description:**
* Fix early exits not shutting down client/server in bootstrapping

**Link to tracking Issue:** Closes #31943

**Testing:**
I tested manually adding errors into the code. There isn't a good,
consistent way to add e.g. the timeout error as-is.

---------

Co-authored-by: Daniel Jaglowski <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working cmd/opampsupervisor
Projects
None yet
2 participants