Closed SeanFeldman closed 8 years ago
Anyone who's using Azure Service Bus transports and using Bus.Send() or Bus.Publish() in a very tight loop with multiple threads.
Bus.Send()
Bus.Publish()
Due to a calculation error that can happen with concurrent access an IndexOutOfRangeException exception can be thrown
IndexOutOfRangeException
Reported in GG: https://groups.google.com/forum/#!topic/particularsoftware/a1GigfXhI94
CircularBuffer.Get() is not thread safe and may throw exception when used in concurrent mode
CircularBuffer.Get()
Repro:
Parallel.ForEach(hugeArray, new ParallelOptions() { MaxDegreeOfParallelism = 5 }, item => { Bus.Send(new SomethingCommand { Item = item }); });
Connects to Particular/NServiceBus.AzureServiceBus#59
Who's affected
Anyone who's using Azure Service Bus transports and using
Bus.Send()
orBus.Publish()
in a very tight loop with multiple threads.Symptoms
Due to a calculation error that can happen with concurrent access an
IndexOutOfRangeException
exception can be thrownReported in GG: https://groups.google.com/forum/#!topic/particularsoftware/a1GigfXhI94
CircularBuffer.Get()
is not thread safe and may throw exception when used in concurrent modeRepro:
Connects to Particular/NServiceBus.AzureServiceBus#59