Skip to content

Commit c174f4b

Browse files
author
John Simons
committed
Merge branch 'hotfix-1.1.5'
2 parents c0ab6c7 + 0e27c69 commit c174f4b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/NServiceBus.RabbitMQ/RabbitMqDequeueStrategy.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ public void Init(Address address, TransactionSettings transactionSettings, Func<
6363
public void Start(int maximumConcurrencyLevel)
6464
{
6565
tokenSource = new CancellationTokenSource();
66-
countdownEvent = new CountdownEvent(maximumConcurrencyLevel);
66+
// We need to add an extra one because if we fail and the count is at zero already, it doesn't allow us to add one more.
67+
countdownEvent = new CountdownEvent(maximumConcurrencyLevel + 1);
6768

6869
for (var i = 0; i < maximumConcurrencyLevel; i++)
6970
{
@@ -82,6 +83,7 @@ public void Stop()
8283
}
8384

8485
tokenSource.Cancel();
86+
countdownEvent.Signal();
8587
countdownEvent.Wait();
8688
}
8789

0 commit comments

Comments
 (0)