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

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.

There are no affected stable branches where the fix should be backported.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants