question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

[BUG] ServiceFabricProcessor throws an unexpected OperationCanceledException exception

See original GitHub issue

This 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).

  1. 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}
  1. CloseAsync is called with Reason = Cancelled

  2. 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:closed
  • Created 4 years ago
  • Comments:11 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
adrianhallcommented, Oct 21, 2019

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.

0reactions
msftbot[bot]commented, Oct 7, 2021

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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found