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 deadlock in Go tests when Debug Server startup fails. #4316

Conversation

OhmSpectator
Copy link
Member

@OhmSpectator OhmSpectator commented Oct 1, 2024

In startIntegratedPSICollectorAPI, if the server does not start within 10 seconds, the function returns an error without unlocking psiServerMutex. This oversight leads to a deadlock in subsequent tests that attempt to acquire the same mutex.

This commit adds psiServerMutex.Unlock() before returning the error to ensure that the mutex is properly released even when the server fails to start.

Needs to be backported to 13.4-stable (which didn't exist when this PR was merged).

In `startIntegratedPSICollectorAPI`, if the server does not start within
10 seconds, the function returns an error without unlocking
`psiServerMutex`. This oversight leads to a deadlock in subsequent tests
that attempt to acquire the same mutex.

This commit adds `psiServerMutex.Unlock()` before returning the error to
ensure that the mutex is properly released even when the server fails to
start.

Signed-off-by: Nikolay Martyanov <nikolay@zededa.com>
@OhmSpectator OhmSpectator merged commit 7dd83ea into lf-edge:master Oct 1, 2024
21 of 23 checks passed
@OhmSpectator OhmSpectator added bug Something isn't working stable Should be backported to stable release(s) labels Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working stable Should be backported to stable release(s)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants