简体   繁体   English

队列触发的Azure Webjob的时间限制

[英]Time limit on Azure Webjobs triggered by Queue

Are there any time limits on the queue triggered function inside an azure web job. azure Web作业中的队列触发功能是否有时间限制? My function takes about 20-30 mins since it needs to go over a lot of records in the DB. 我的函数大约需要20-30分钟,因为它需要遍历数据库中的许多记录。 The function status in the end is Never Finished. 最后的功能状态为“永不结束”。 I put in the settings.job file with { "stopping_wait_time": 1800 } - with no effect. 我将{。“ stopping_wait_time”:1800}放入settings.job文件-没有任何效果。 But within five minutes or so its status is set to Never Finished. 但是在五分钟左右的时间内,其状态将设置为“永不结束”。 I searched and yes found some ppl asking similar questions - with no definitive answers. 我搜索了,是的,发现有人问类似的问题-没有明确的答案。 I found some exceptions in the logs and the exceptions seemed to be generated from Azure storage. 我在日志中发现了一些异常,这些异常似乎是从Azure存储生成的。 I searched and found there were some issues with logging, so i commented out logging code within the function - still no go. 我搜索发现日志记录存在一些问题,因此我注释掉了函数中的日志记录代码-仍然行不通。 Also i found one question that mentioned some connection strings - so now i have these; 我也发现了一个提到一些连接字符串的问题-现在我有了这些。 AzureWebJobsStorage, AzureWebJobsDashboard, AzureJobsRuntime, AzureJobsData - all pointing to the same storage account - still no go. AzureWebJobsStorage,AzureWebJobsDashboard,AzureJobsRuntime,AzureJobsData-都指向同一个存储帐户-仍然无法使用。

I tried to debug, and see where the timeout occurs and it seems like it is happening even before my function is actually hit, 我尝试进行调试,看看超时发生在哪里,甚至在我的函数真正被执行之前,它似乎正在发生,

Output is something like below; 输出如下所示;

A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.Net.WebException' occurred in System.dll
A first chance exception of type 'System.TimeoutException' occurred in Microsoft.WindowsAzure.Storage.dll
A first chance exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occurred in Microsoft.WindowsAzure.Storage.dll
A first chance exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occurred in Microsoft.WindowsAzure.Storage.dll
A first chance exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occurred in mscorlib.dll
A first chance exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occurred in mscorlib.dll
A first chance exception of type 'Microsoft.WindowsAzure.Storage.StorageException' occurred in Microsoft.Azure.WebJobs.Host.dll
System.Transactions Critical: 0 : <TraceRecord xmlns="http://schemas.microsoft.com/2004/10/E2ETraceEvent/TraceRecord" Severity="Critical"><TraceIdentifier>http://msdn.microsoft.com/TraceCodes/System/ActivityTracing/2004/07/Reliability/Exception/Unhandled</TraceIdentifier><Description>Unhandled exception</Description><AppDomain>PnCProcessor.exe</AppDomain><Exception><ExceptionType>Microsoft.WindowsAzure.Storage.StorageException, Microsoft.WindowsAzure.Storage, Version=4.3.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35</ExceptionType><Message>The client could not finish the operation within specified timeout.</Message><StackTrace>   at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result)
at Microsoft.WindowsAzure.Storage.Queue.CloudQueue.EndExists(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.&amp;lt;&amp;gt;c__DisplayClass1`1.&amp;lt;CreateCallback&amp;gt;b__0(IAsyncResult ar)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.WebJobs.Host.Queues.Listeners.QueueListener.&amp;lt;ExecuteAsync&amp;gt;d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.WebJobs.Host.Timers.TaskSeriesTimer.&amp;lt;RunAsync&amp;gt;d__d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.WebJobs.Host.Timers.BackgroundExceptionDispatcher.&amp;lt;&amp;gt;c__DisplayClass1.&amp;lt;Throw&amp;gt;b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()</StackTrace><ExceptionString>Microsoft.WindowsAzure.Storage.StorageException: The client could not finish the operation within specified timeout. ---&amp;gt; System.TimeoutException: The client could not finish the operation within specified timeout.
--- End of inner exception stack trace ---
at Microsoft.WindowsAzure.Storage.Core.Executor.Executor.EndExecuteAsync[T](IAsyncResult result)
at Microsoft.WindowsAzure.Storage.Queue.CloudQueue.EndExists(IAsyncResult asyncResult)
at Microsoft.WindowsAzure.Storage.Core.Util.AsyncExtensions.&amp;lt;&amp;gt;c__DisplayClass1`1.&amp;lt;CreateCallback&amp;gt;b__0(IAsyncResult ar)
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.WebJobs.Host.Queues.Listeners.QueueListener.&amp;lt;ExecuteAsync&amp;gt;d__4.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at Microsoft.Azure.WebJobs.Host.Timers.TaskSeriesTimer.&amp;lt;RunAsync&amp;gt;d__d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.WebJobs.Host.Timers.BackgroundExceptionDispatcher.&amp;lt;&amp;gt;c__DisplayClass1.&amp;lt;Throw&amp;gt;b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()
Request Information
RequestID:
RequestDate:
StatusMessage:
</ExceptionString><InnerException><ExceptionType>System.TimeoutException, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</ExceptionType><Message>The client could not finish the operation within specified timeout.</Message><StackTrace>   at Microsoft.Azure.WebJobs.Host.Timers.BackgroundExceptionDispatcher.&amp;lt;&amp;gt;c__DisplayClass1.&amp;lt;Throw&amp;gt;b__0()
at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean preserveSyncCtx)
at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
at System.Threading.ThreadHelper.ThreadStart()

System.TimeoutException: The client could not finish the operation within specified timeout. System.TimeoutException:客户端无法在指定的超时时间内完成操作。

I am using a S1 web app and a standard-GRS storage account for this. 我为此使用了一个S1 Web应用程序和一个标准GRS存储帐户。

So questions are; 问题是;
1. Are there any time limitations on the time the queue triggered function takes? 1.队列触发功能花费的时间是否有时间限制?
2. If there are time limitations is there any way to override those? 2.如果有时间限制,有什么方法可以克服这些限制?
3. I have to use a queue triggered function since i need to pass some parameters to the function - which are passed from another scheduled web job. 3.我必须使用队列触发的函数,因为我需要将一些参数传递给该函数-这些参数是从另一个计划的Web作业传递的。 I can make an on-demand webjob and pass the parameters on the command line - but then is there a way to call an on-demand webjob from a scheduled webjob? 我可以按需制作Webjob并在命令行上传递参数-但是有没有办法从计划的webjob调用按需Webjob?

Thanks for your help! 谢谢你的帮助!

No there is no limit on execution time of queue triggered job functions. 队列触发的作业功能的执行时间没有限制。 However there are a few things you have to ensure you set up properly so your JobHost continues to run. 但是,您需要确保设置正确,以便JobHost继续运行。 When using the Azure WebJobs SDK you need to deploy your JobHost Console exe as a continuously running WebJob , and enable Always On . 使用Azure WebJobs SDK时,需要将JobHost Console exe部署为连续运行的WebJob ,并启用Always On Both of those are described in detail on this documentation page under the "Create a continuously running WebJob" section. 本文档页面的“创建连续运行的WebJob”部分下对此都有详细说明。

See the "Notes" section of that page for relevant details on the timeout limits when running in the Free tier (20 minute timeout), which can be removed by moving to Basic or Standard tier. 有关在免费层中运行的超时限制(20分钟超时)的相关详细信息,请参阅该页面的“注释”部分,可以通过移至基本或标准层来删除超时限制。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM