天蓝网络作业中队列触发功能是否有时间限制。我的功能大约需要20-30分钟,因为它需要查看数据库中的大量记录。最后的功能状态是从未完成。我使用{" stopping_wait_time":1800}放入了settings.job文件 - 没有任何效果。但是在五分钟左右的时间里,它的状态将被设置为Never Finished。我搜索过,是的,发现一些人问类似的问题 - 没有明确的答案。我在日志中发现了一些例外,似乎是从Azure存储生成异常。我搜索并发现日志记录存在一些问题,所以我在功能中注释了日志代码 - 仍然没有去。此外,我发现一个问题提到了一些连接字符串 - 所以现在我有这些; AzureWebJobsStorage,AzureWebJobsDashboard,AzureJobsRuntime,AzureJobsData - 都指向相同的存储帐户 - 仍然没有。
我尝试调试,看看超时发生的地方,看起来它甚至在我的功能实际被击中之前就已经发生了,
输出如下所示;
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.&lt;&gt;c__DisplayClass1`1.&lt;CreateCallback&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.&lt;ExecuteAsync&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.&lt;RunAsync&gt;d__d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.WebJobs.Host.Timers.BackgroundExceptionDispatcher.&lt;&gt;c__DisplayClass1.&lt;Throw&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. ---&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.&lt;&gt;c__DisplayClass1`1.&lt;CreateCallback&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.&lt;ExecuteAsync&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.&lt;RunAsync&gt;d__d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at Microsoft.Azure.WebJobs.Host.Timers.BackgroundExceptionDispatcher.&lt;&gt;c__DisplayClass1.&lt;Throw&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.&lt;&gt;c__DisplayClass1.&lt;Throw&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:客户端无法在指定的超时内完成操作。
我正在使用S1网络应用程序和标准GRS存储帐户。
所以问题是;
1.队列触发功能的时间是否有时间限制?
2.如果有时间限制,有没有办法超越这些?
3.我必须使用队列触发函数,因为我需要将一些参数传递给函数 - 这些参数是从另一个计划的Web作业传递的。我可以创建一个按需webjob并在命令行上传递参数 - 但是有没有办法从预定的webjob调用按需webjob?
感谢您的帮助!
答案 0 :(得分:1)
队列触发的作业功能的执行时间没有限制。但是,有一些事项可以确保您正确设置,以便JobHost
继续运行。使用Azure WebJobs SDK时,您需要将JobHost
Console exe作为持续运行的WebJob 进行部署,并启用始终开启。这些都在&#34;创建一个持续运行的WebJob&#34;的this documentation page上详细描述。部分。
参见&#34; Notes&#34;该页面的部分,了解在免费套餐(20分钟超时)中运行时超时限制的相关详细信息,可以通过转移到基本或标准层来删除。