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

Bugfix SQLServerMemory semaphore not released properly #883

Merged
merged 1 commit into from
Nov 11, 2024

Conversation

snakex64
Copy link
Contributor

@snakex64 snakex64 commented Nov 8, 2024

Motivation and Context (Why the change? What's the scenario?)

A simple bugfix for SQLServerMemory. The semaphore wasn't released when "is ready" changes from "false" to "true" while the code was waiting for the semaphore. Meaning if specifically 3 or more tasks run into that code at the same time, the third task as well as all others are gonna be stuck in a deadlock waiting for the semaphore. This only happens during the first initialization, since subsequent calls will leave before waiting for the semaphore.

@snakex64 snakex64 requested a review from dluc as a code owner November 8, 2024 17:16
@dluc dluc merged commit ad4a996 into microsoft:main Nov 11, 2024
6 checks passed
@marcominerva
Copy link
Contributor

@snakex64 @dluc Surely I'm missing something, but I'm wondering how this change (an if instrctuion moved inside a try... catch block):

image

Will modify the behavior?

@dluc
Copy link
Collaborator

dluc commented Nov 12, 2024

@snakex64 @dluc Surely I'm missing something, but I'm wondering how this change (an if instrctuion moved inside a try... catch block):

image

Will modify the behavior?

it's about the code executed in finally

@marcominerva
Copy link
Contributor

Oh... I see, in this way the return causes the semaphore to be released. Thank you for the clarification!

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