[BUG] ServiceFabricProcessor throws an unexpected OperationCanceledException exception
See original GitHub issueThis bug is similar to https://github.com/Azure/azure-sdk-for-net/issues/7933 The difference is the type of the exception thrown (+ I have some more details now).
- ProcessErrorAsync is called with the following exception:
System.OperationCanceledException: The operation was canceled.
at Microsoft.Azure.Amqp.AsyncResult.End[TAsyncResult](IAsyncResult result)
at Microsoft.Azure.Amqp.ReceivingAmqpLink.EndReceiveMessages(IAsyncResult result, IEnumerable`1& messages)
at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.EventHubs.Amqp.AmqpPartitionReceiver.OnReceiveAsync(Int32 maxMessageCount, TimeSpan waitTime)
at Microsoft.Azure.EventHubs.Amqp.AmqpPartitionReceiver.OnReceiveAsync(Int32 maxMessageCount, TimeSpan waitTime)
at Microsoft.Azure.EventHubs.PartitionReceiver.ReceiveAsync(Int32 maxMessageCount, TimeSpan waitTime)
at Microsoft.Azure.EventHubs.Amqp.AmqpPartitionReceiver.ReceivePumpAsync(CancellationToken cancellationToken, Boolean invokeWhenNoEvents)
{"Type":"System.OperationCanceledException", "CancellationToken":{"IsCancellationRequested":false, "CanBeCanceled":false, "WaitHandle":{"Handle":"2244", "SafeWaitHandle":{"IsInvalid":false, "IsClosed":false}}}, "TargetSite":"Void Throw()", "StackTrace":" at Microsoft.Azure.Amqp.AsyncResult.End[TAsyncResult](IAsyncResult result)\r\n at Microsoft.Azure.Amqp.ReceivingAmqpLink.EndReceiveMessages(IAsyncResult result, IEnumerable`1& messages)\r\n at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)\r\n--- End of stack trace from previous location where exception was thrown ---\r\n at Microsoft.Azure.EventHubs.Amqp.AmqpPartitionReceiver.OnReceiveAsync(Int32 maxMessageCount, TimeSpan waitTime)\r\n at Microsoft.Azure.EventHubs.Amqp.AmqpPartitionReceiver.OnReceiveAsync(Int32 maxMessageCount, TimeSpan waitTime)\r\n at Microsoft.Azure.EventHubs.PartitionReceiver.ReceiveAsync(Int32 maxMessageCount, TimeSpan waitTime)\r\n at Microsoft.Azure.EventHubs.Amqp.AmqpPartitionReceiver.ReceivePumpAsync(CancellationToken cancellationToken, Boolean invokeWhenNoEvents)", "Message":"The operation was canceled.", "Data":{}, "Source":"System.Private.CoreLib", "HResult":-2146233029}
-
CloseAsync is called with Reason = Cancelled
-
ServiceFabricProcessor.RunAsync throws
System.OperationCanceledException: The operation was canceled.
at Microsoft.Azure.EventHubs.ServiceFabricProcessor.ServiceFabricProcessor.RunAsync(CancellationToken fabricCancellationToken)
at MyClass.RunAsync(CancellationToken cancellationToken)
The important thing here is that the CancellationToken passed to ServiceFabricProcessor.RunAsync() is NOT cancelled.
@JamesBirdsall Does this information help in any way?
Issue Analytics
- State:
- Created 4 years ago
- Comments:11 (5 by maintainers)
Top Results From Across the Web
C# : OperationCanceledException : The operation was ...
An OperationCanceledException exception typically means that an Event Hubs service operation timed out. In your stack trace, it appears that ...
Read more >Event Hubs messaging exceptions - .NET (legacy)
Generic messaging exception that may be thrown in the following cases: An attempt is made to create a QueueClient using a name or...
Read more >C# : System.OperationCanceledException: The operation ...
I have a function app that is throwing a "System.OperationCanceledException: The operation was canceled" exception in chunks.
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I’d have to check with the service team to be sure. However, that does happen if we know of a major issue. To get you going, I’d downgrade to 0.5.4 (the latest version listed on NuGet), and see if you still experience the problem.
Hi @dmytro-gokun. Thank you for opening this issue and giving us the opportunity to assist. We believe that this has been addressed. If you feel that further discussion is needed, please add a comment with the text “
/unresolve
” to remove the “issue-addressed” label and continue the conversation.