Closed libzlibz closed 6 months ago
@kandersen82 could you have a look at this?
Hi @libzlibz. Are you able to provide a valid C# example illustrating the problem?
@libzlibz Could you link to a repository showcasing the issue ?
@libzlibz We appreciate the report, but we need a working C# sample showing the bug. Can you provide us with that?
Closed due to inactivity
Description
SendChannel.Completion causes the producer to become Faulted
Reproduction Steps
// ---Thread1--- // while(true) { // a:producer.Send a batch of data // a:await producer.SendChannel.Completion // ->a:await _sendQueue.WaitForEmpty // ->a:tcs = new TaskCompletionSource
// TrySetResult will notify await tcs.Task completed, then Thread1 continues to run, and then b: _queueEmptyTcs.Add(tcs) modified _queueEmptyTcs, causing foreach issue in Thread2 // Additionally, it was found that a:await tcs.Task was return after 1:tcs.TrySetResult(0), The code behind the (await tcs.Task) runs in Thread2, so every time you enter NotifyQueueEmptyAwaiters, there will always be a problem // Do not add: lock (_queue) to void NotifyQueueEmptyAwaiters(), After testing, on the same thread, it was found that it will not lock, but errors will still be reported
Expected behavior
Normal and stable production data
Actual behavior
producer to become Faulted
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response