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

Continue renewing lock while processing #22257

Merged
merged 3 commits into from
Jun 29, 2021

Conversation

JoshLove-msft
Copy link
Member

Fixes #22143

@JoshLove-msft JoshLove-msft requested a review from jsquire as a code owner June 28, 2021 21:21
@ghost ghost added the Service Bus label Jun 28, 2021
@JoshLove-msft
Copy link
Member Author

/azp run net - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JoshLove-msft
Copy link
Member Author

/azp run net - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JoshLove-msft JoshLove-msft added this to the [2021] July milestone Jun 29, 2021
@JoshLove-msft
Copy link
Member Author

/azp run net - servicebus - tests

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@JoshLove-msft JoshLove-msft enabled auto-merge (squash) June 29, 2021 01:06
});

int receivedCount = 0;
var tcs = new TaskCompletionSource<bool>();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var tcs = new TaskCompletionSource<bool>();
var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);

Copy link
Member Author

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);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
tcs.SetResult(true);
tcs.TrySetResult(true);

Copy link
Member

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.

Copy link
Member Author

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>();
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
var tcs = new TaskCompletionSource<bool>();
var tcs = new TaskCompletionSource<bool>(TaskCreationOptions.RunContinuationsAsynchronously);

var ct = Interlocked.Increment(ref receivedCount);
if (ct == messageCount)
{
tcs.SetResult(true);
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
tcs.SetResult(true);
tcs.TrySetResult(true);

@JoshLove-msft JoshLove-msft merged commit f553697 into Azure:main Jun 29, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[BUG] Don't cancel autolockrenewal on StopProcessingAsync call
2 participants