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

fix: healthcheckv2extension: fix deadlock in case of an error in http server start #38269

Conversation

lim123123123
Copy link
Contributor

Description

The current implementation uses a channel for graceful shutdown, but it doesn't work in case of an error during socket binding. Since the goroutine that writes to that channel is never created, it causes a deadlock in Shutdown.

This is a minor issue, but it annoys me. Each time I forget to shut down the previous debug session, the new one freezes (since the address is already in use, causing an error in Start).

Link to tracking issue

Fixes
Since this is a really small problem, I didn't create an issue. Let me know if it's required, and I'll create one.

Testing

I've added a unit test that fails with the current implementation but works with the fix.

@lim123123123 lim123123123 requested review from jpkrohling, mwear and a team as code owners February 28, 2025 14:40
Copy link

linux-foundation-easycla bot commented Feb 28, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@lim123123123 lim123123123 force-pushed the k.garmanov/healthcheckv2-shutdown-fix branch from fbf5cb3 to 215d8af Compare February 28, 2025 14:45
Copy link
Contributor

@atoulme atoulme left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes make sense to me. Please add a changelog.

@lim123123123
Copy link
Contributor Author

I've added the changelog entry, and also have fixed the linter. Could you re-review? @atoulme

@atoulme atoulme merged commit 0962a6b into open-telemetry:main Mar 5, 2025
156 checks passed
@github-actions github-actions bot added this to the next release milestone Mar 5, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants