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

Service Bus Scheduled Message Count Is Negative #254

Closed
rcreynolds53 opened this issue Dec 14, 2018 · 8 comments
Closed

Service Bus Scheduled Message Count Is Negative #254

rcreynolds53 opened this issue Dec 14, 2018 · 8 comments

Comments

@rcreynolds53
Copy link

rcreynolds53 commented Dec 14, 2018

Description

When cancelling scheduled messages without knowing the sequence number, I used the following
code using the ServiceBus Message Receiver Class to peek at all messages and then cancel the scheduled messages async. Instead of stopping at zero, when there were no more messages to cancel, the service bus kept deleting messages from the scheduled queue and ended up with a negative number

CODE
var messages = await messageReceiver.PeekAsync(250);
do
{
Console.WriteLine(messages.Count);
await Task.WhenAll(messages.Select(m =>
{
Console.WriteLine(m.SystemProperties.SequenceNumber);
return queueClient.CancelScheduledMessageAsync(m.SystemProperties.SequenceNumber);
}));
messages = await messageReceiver.PeekAsync(250);
} while (messages.Count > 0);

Here is a picture of the message count: image

Actual Behavior

  1. Service bus is displaying a negative number for the scheduled messages

Expected Behavior

  1. When deleting the scheduled messages the service bus count should not be able to go negative.
@axisc
Copy link
Contributor

axisc commented Mar 4, 2019

Thanks for reporting this. we're tracking this internally.

@axisc axisc added the bug label Mar 4, 2019
@calvaradocl
Copy link

This is happening to me too, but I'm deleting the scheduled messages by their Sequence Number. Same negative information on both ServiceBusExplorer and Azure Portal.

@axisc axisc added the backlog label Apr 22, 2019
@axisc
Copy link
Contributor

axisc commented Apr 22, 2019

we're currently working to fix this. I'll update and close this issue when we have sorted this out.

@SeanFeldman
Copy link
Contributor

@axisc the label backlog is not exactly going along with your comment. Perhaps you meant to apply in-progress label?

@aresowj
Copy link

aresowj commented Jun 3, 2019

Hi @rcreynolds53 & @calvaradocl , just want to confirm for debugging purpose, was there any activities (scheduling / send / receive messages) while the cancellation was going on?

Also, is the piece of code running as a single instance? I.e., are there multiple instances of this code running in parallel maybe with cancelling faster in mind?

Thank you.

@aresowj
Copy link

aresowj commented Sep 18, 2019

Update: we have checked in the fix for both standard and premium messaging, the fix is expected to be included in the next major deployment.

@JSCProjects
Copy link

This is still happening within our subscriptions. Our sagas depend on scheduled messages and our ops team is complaining that they can't rely on this number.

@jrgcubano
Copy link

Same here. Still happening on our side.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

7 participants