-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Continue renewing lock while processing #22257
Conversation
/azp run net - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run net - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
/azp run net - servicebus - tests |
Azure Pipelines successfully started running 1 pipeline(s). |
}); | ||
|
||
int receivedCount = 0; | ||
var tcs = new TaskCompletionSource<bool>(); |
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.
var tcs = new TaskCompletionSource<bool>(); | |
var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously); |
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.
Ah I had auto-merge enabled, but I don't think this will be a huge impact being that this is a test rather than the produce code.
var ct = Interlocked.Increment(ref receivedCount); | ||
if (ct == messageCount) | ||
{ | ||
tcs.SetResult(true); |
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.
tcs.SetResult(true); | |
tcs.TrySetResult(true); |
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.
Probably not necessary due to the increment, but can't hurt.
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.
This shouldn't be necessary and could potentially obscure other issues in the test.
}); | ||
|
||
int receivedCount = 0; | ||
var tcs = new TaskCompletionSource<bool>(); |
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.
var tcs = new TaskCompletionSource<bool>(); | |
var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously); |
var ct = Interlocked.Increment(ref receivedCount); | ||
if (ct == messageCount) | ||
{ | ||
tcs.SetResult(true); |
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.
tcs.SetResult(true); | |
tcs.TrySetResult(true); |
Fixes #22143