Azure / azure-service-bus-dotnet

☁️ .NET Standard client library for Azure Service Bus
https://azure.microsoft.com/services/service-bus
Other
235 stars 120 forks source link

Session receiver stops processing next sessions #687

Open petrformanek opened 5 years ago

petrformanek commented 5 years ago

Actual Behavior

  1. I have simple session enabled subscription consumed by following code snippet
  2. Processing of messages takes longer than MaxAutoRenewDuration
  3. After processing of the first message the pump gets stuck and no other messages are processed

Expected Behavior

  1. Message processing will continue with another session

Discovered bug

  1. From debugging it looks like a bug in method SessionReceivePump.MessagePumpTaskAsync in finally block.
  2. When calling CancelAndDisposeCancellationTokenSource(renewLockCancellationTokenSource); there is a ObjectDisposedException and because of that this.maxConcurrentSessionsSemaphoreSlim.Release(); is not called and pump gets stuck while waiting on semaphore release.

Versions

Might be related to issue #595.

axisc commented 5 years ago

@petrformanek thanks for reporting this. We confirmed that this is a bug.

We'll add this to the backlog, but alternatively feel free to submit a PR and we can review and approve.

petrformanek commented 5 years ago

Hi guys, any ETA for the fix?