We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 75822ae commit c48822cCopy full SHA for c48822c
projects/RabbitMQ.Client/ConsumerDispatching/ConsumerDispatcherChannelBase.cs
@@ -161,10 +161,17 @@ public async Task WaitForShutdownAsync()
161
{
162
try
163
164
- await _reader.Completion
165
- .ConfigureAwait(false);
166
await _worker
167
.ConfigureAwait(false);
+
+ /*
168
+ * rabbitmq/rabbitmq-dotnet-client#1751
169
+ *
170
+ * Wait for the worker first to ensure all items have been read out of the channel,
171
+ * otherwise the following will never return (https://stackoverflow.com/a/66521303)
172
+ */
173
+ await _reader.Completion
174
+ .ConfigureAwait(false);
175
}
176
catch (AggregateException aex)
177
0 commit comments