We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 851044d commit dfc1206Copy full SHA for dfc1206
src/Proto.Cluster/PubSub/BatchingProducer.cs
@@ -214,10 +214,9 @@ private void RemoveCancelledFromBatch(PubSubBatchWithReceipts batchWrapper)
214
215
private void StopAcceptingNewMessages()
216
{
217
- if (!_publisherChannel.Reader.Completion.IsCompleted)
218
- {
219
- _publisherChannel.Writer.Complete();
220
- }
+ // Attempt to complete the channel without throwing if it has already been closed
+ // The publisher loop and publish error handling might both call this concurrently
+ _publisherChannel.Writer.TryComplete();
221
}
222
223
private async Task PublishBatch(PubSubBatchWithReceipts batchWrapper)
0 commit comments