-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Don't release SemaphoreSlim when it is canceled #12818
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
Conversation
🆙 📅 |
d176d69
to
965f990
Compare
{ | ||
if (!CheckAccess()) | ||
{ | ||
throw new InvalidOperationException( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm not a super fan of this API. Telling the user to do this isn't helpful all the time - for example, user code is not involved in the CircuitHost
where this is used, so throwing an exception stating they should do something when it's our bug doesn't seem right.
Could we write something specific in the host instead?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It won't happen though.
We could do extra work to have a worse error message for a case that should never happen. Or we can call the API that does what we want, with the expectation that it won't happen.
965f990
to
2414c7f
Compare
c6ff794
to
9ac7437
Compare
9ac7437
to
7418fab
Compare
This comment was made automatically. If there is a problem contact [email protected]. I've triaged the above build. I've created/commented on the following issue(s) |
2cbacbb
to
4e1332c
Compare
4e1332c
to
49b5550
Compare
@ajaybhargavb - is this is blocked on anything? If there are unrelated tests that are failing, mark as flaky and move on 😁 |
49b5550
to
ae4f195
Compare
Fixes #11686
We don't want to reuse the semaphoreslim when it is cancelled. So moving it out of try block so it doesn't try to release it.