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

[13.4-stable] Fix deadlock when Debug Server startup fails. #4332

Conversation

OhmSpectator
Copy link
Member

It's a backport of #4316

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>
(cherry picked from commit 7dd83ea)
Copy link
Contributor

@eriknordmark eriknordmark left a comment

Choose a reason for hiding this comment

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

LGTM (but a defer unlock on the line after the lock is easier to review).
Makes sense to keep this identical to what is in master.

@OhmSpectator
Copy link
Member Author

LGTM (but a defer unlock on the line after the lock is easier to review). Makes sense to keep this identical to what is in master.

It was exactly my thoughts =) I don't know why I decided not to do it in the first place.

@OhmSpectator OhmSpectator merged commit 97654b4 into lf-edge:13.4-stable Oct 11, 2024
37 of 38 checks passed
@OhmSpectator OhmSpectator deleted the backport/13.4/fix-gotest-deadlock branch October 11, 2024 08:17
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.

2 participants