Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add retry logic to EventHubAsyncCollector.SendBatchAsync in the partitioned-output branch #84

Closed
Francisco-Gamino opened this issue Dec 15, 2020 · 2 comments

Comments

@Francisco-Gamino
Copy link

Francisco-Gamino commented Dec 15, 2020

A customer reported some issues when writing to Event Hub for their function app. The exception points to SendBatchAsync.

After reaching out to the Event Hub team, they mentioned that this could be caused by a networking issue, so adding retry logic will help mitigate this. The fix has to go in partitioned-output branch.

Here is the full stack trace:

Microsoft.Azure.WebJobs.Host.FunctionInvocationException : Exception while executing function: <FunctionName> ---> System.InvalidOperationException : Error while handling parameter _binder after function returned: ---> System.TimeoutException : The operation did not complete within the allocated time 00:00:00 for object out-connection82.
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at Microsoft.Azure.Amqp.AsyncResult.End[TAsyncResult](IAsyncResult result)
   at Microsoft.Azure.Amqp.AmqpObject.OpenAsyncResult.End(IAsyncResult result)
   at Microsoft.Azure.Amqp.AmqpObject.EndOpen(IAsyncResult result)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar,Func`2 endFunction,Action`1 endAction,Task`1 promise,Boolean requiresSynchronization)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.EventHubs.Amqp.AmqpEventHubClient.CreateConnectionAsync(TimeSpan timeout)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.Amqp.FaultTolerantAmqpObject`1.OnCreateAsync[T](TimeSpan timeout)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.Amqp.Singleton`1.CreateValue[TValue](TaskCompletionSource`1 tcs,TimeSpan timeout)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.Amqp.Singleton`1.GetOrCreateAsync[TValue](TimeSpan timeout)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.EventHubs.Amqp.AmqpEventDataSender.CreateLinkAsync(TimeSpan timeout)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.Amqp.FaultTolerantAmqpObject`1.OnCreateAsync[T](TimeSpan timeout)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.Amqp.Singleton`1.CreateValue[TValue](TaskCompletionSource`1 tcs,TimeSpan timeout)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.Amqp.Singleton`1.GetOrCreateAsync[TValue](TimeSpan timeout)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.EventHubs.Amqp.AmqpEventDataSender.OnSendAsync(IEnumerable`1 eventDatas,String partitionKey)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.EventHubs.Amqp.AmqpEventDataSender.OnSendAsync(IEnumerable`1 eventDatas,String partitionKey)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.EventHubs.EventHubClient.SendAsync(??)
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.Azure.WebJobs.EventHubs.EventHubAsyncCollector.SendBatchAsync(String partitionKey,IEnumerable`1 batch)

cc: @amamounelsayed @alrod

@alrod
Copy link
Member

alrod commented Feb 4, 2022

we are not going to support "partitioned-output" branch. Please create a new feature request in track2 if needed.

@alrod alrod closed this as completed Feb 4, 2022
@alrod
Copy link
Member

alrod commented Mar 24, 2022

EventHubClient has the default retry policy: retry up to 9 times with an exponential back-off time of up to 30 seconds.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants