You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "libzlibz (via GitHub)" <gi...@apache.org> on 2024/03/21 05:31:46 UTC

[I] SendChannel.Completion causes the producer to become Faulted [pulsar-dotpulsar]

libzlibz opened a new issue, #209:
URL: https://github.com/apache/pulsar-dotpulsar/issues/209

   ### 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<object>();
   //      a:_queueEmptyTcs.Add(tcs);
   //      a:await tcs.Task
   // 
   //                             ---Thread2---
   //                             SubProducer::ProcessReceipt
   //                                 _sendQueue.Dequeue();
   //                                     if (_queue.Count == 0)
   //                                         NotifyQueueEmptyAwaiters();
   //                                             1:foreach (var tcs in _queueEmptyTcs)
   //                                             1:	tcs.TrySetResult(0);
   //
   // Return to running the statement following: await tcs.Task
   // b:producer.Send
   // b:await producer.SendChannel.Completion
   //      b:_queueEmptyTcs.Add(tcs);(Modified _queueEmptyTcs)
   //      b:await tcs.Task
   // 
   //                             ---Thread2-------------------------
   //                                             2:foreach (var tcs in _queueEmptyTcs) //When running within foreach, _queueEmptyTcs has been modified and there is an issue at this time
   //                                              Throwing exception: Collection was modified; enumeration operation may not execute
   //                                              producer set to Faulted
   // }
   
   // 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_


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] SendChannel.Completion causes the producer to become Faulted [pulsar-dotpulsar]

Posted by "blankensteiner (via GitHub)" <gi...@apache.org>.
blankensteiner commented on issue #209:
URL: https://github.com/apache/pulsar-dotpulsar/issues/209#issuecomment-2011663856

   @kandersen82 could you have a look at this?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] SendChannel.Completion causes the producer to become Faulted [pulsar-dotpulsar]

Posted by "blankensteiner (via GitHub)" <gi...@apache.org>.
blankensteiner commented on issue #209:
URL: https://github.com/apache/pulsar-dotpulsar/issues/209#issuecomment-2063086262

   @libzlibz We appreciate the report, but we need a working C# sample showing the bug. Can you provide us with that?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] SendChannel.Completion causes the producer to become Faulted [pulsar-dotpulsar]

Posted by "entvex (via GitHub)" <gi...@apache.org>.
entvex commented on issue #209:
URL: https://github.com/apache/pulsar-dotpulsar/issues/209#issuecomment-2048084570

   @libzlibz Could you link to a repository showcasing the issue ?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] SendChannel.Completion causes the producer to become Faulted [pulsar-dotpulsar]

Posted by "blankensteiner (via GitHub)" <gi...@apache.org>.
blankensteiner commented on issue #209:
URL: https://github.com/apache/pulsar-dotpulsar/issues/209#issuecomment-2074347242

   Closed due to inactivity


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] SendChannel.Completion causes the producer to become Faulted [pulsar-dotpulsar]

Posted by "kandersen82 (via GitHub)" <gi...@apache.org>.
kandersen82 commented on issue #209:
URL: https://github.com/apache/pulsar-dotpulsar/issues/209#issuecomment-2036206478

   Hi @libzlibz. Are you able to provide a valid C# example illustrating the problem?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


Re: [I] SendChannel.Completion causes the producer to become Faulted [pulsar-dotpulsar]

Posted by "blankensteiner (via GitHub)" <gi...@apache.org>.
blankensteiner closed issue #209: SendChannel.Completion causes the producer to become Faulted
URL: https://github.com/apache/pulsar-dotpulsar/issues/209


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@pulsar.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org