簡體   English   中英

隊列觸發的Azure Webjob的時間限制

[英]Time limit on Azure Webjobs triggered by Queue

azure Web作業中的隊列觸發功能是否有時間限制? 我的函數大約需要20-30分鍾,因為它需要遍歷數據庫中的許多記錄。 最后的功能狀態為“永不結束”。 我將{。“ stopping_wait_time”:1800}放入settings.job文件-沒有任何效果。 但是在五分鍾左右的時間內,其狀態將設置為“永不結束”。 我搜索了,是的,發現有人問類似的問題-沒有明確的答案。 我在日志中發現了一些異常,這些異常似乎是從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.&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:客戶端無法在指定的超時時間內完成操作。

我為此使用了一個S1 Web應用程序和一個標准GRS存儲帳戶。

問題是;
1.隊列觸發功能花費的時間是否有時間限制?
2.如果有時間限制,有什么方法可以克服這些限制?
3.我必須使用隊列觸發的函數,因為我需要將一些參數傳遞給該函數-這些參數是從另一個計划的Web作業傳遞的。 我可以按需制作Webjob並在命令行上傳遞參數-但是有沒有辦法從計划的webjob調用按需Webjob?

謝謝你的幫助!

隊列觸發的作業功能的執行時間沒有限制。 但是,您需要確保設置正確,以便JobHost繼續運行。 使用Azure WebJobs SDK時,需要將JobHost Console exe部署為連續運行的WebJob ,並啟用Always On 本文檔頁面的“創建連續運行的WebJob”部分下對此都有詳細說明。

有關在免費層中運行的超時限制(20分鍾超時)的相關詳細信息,請參閱該頁面的“注釋”部分,可以通過移至基本或標准層來刪除超時限制。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM