触发Web作业完全执行,然后中止并超时121秒后 [英] Triggered Web Job Executing Completely, and then Aborting with Timeout 121 seconds later

查看:81
本文介绍了触发Web作业完全执行,然后中止并超时121秒后的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个Web作业,当将新项目添加到存储队列时,该作业已在Azure中成功触发。

I have a webjob which is successfully being triggered in Azure when a new item is added to the storage queue.

被触发时,我检查日志和所有编写的代码均已正确执行,但Web作业仍处于仍在执行状态,执行后121秒后它将中止。

When it is triggered, I check the logs and all the code written has executed properly, but the web job stays in a "still executing" state, and after 121 seconds after execution it aborts.

以下是该方法将被触发,随后触发日志文件,您可以在其中看到开始处理内容已写入日志,而处理内容已完成已写入日志。这就告诉我一切都执行正常,据我所知,我没有其他特别的事情要做,以表明这已成功执行。

Here is the method that gets triggered followed by the log file where you can see "Start Processing Content" is written to the log and "Processing Content Has Completed" was written to the log. That tells me that everything executed fine, and as far as I know there isn't anything else special that I need to do to signal that this was successfully executed.

因此,我认为Web Jobs应该起作用的方式是,这将被视为成功执行。而是在仪表板上将其标记为失败,并完全停止Web作业(即使它被设计为在连续模式下工作)。此外,App Service设置为Always On。

So, how I think Web Jobs are supposed to work is that this would be considered a successful execution. Instead it is marked as "Failed" in the dashboard and completely stops the web job (even though it is designed to work in continuous mode). Also, App Service is set to Always On.

错误中建议的增加超时没有意义。要做的就是代替完成后121秒超时,而是完成后5分钟或我设置的超时时间。

The recommendations in the error to increase the timeout make no sense. All that would do is instead of timing out 121 seconds after completion, it would timeout 5 mins after completion or whatever I set it to.

对我来说,完全超时是因为超时会在工作甚至表明已成功后中止工作。 (有关这些详细信息,请参阅我在下面用粗体显示的所有要点)。可能是个错误?还是我自己错过了其他设置?还是MS缺少的另一篇文档?

It's completely backwards to me that this timeout would abort the job after the job has even indicated it has "Succeeded". (See all the points I bolded the log below for those details). A bug maybe? Or some other missed setting by myself? Or another piece of absent documentation from MS?

应用服务计划正在付费服务层(B1)上运行。

App Service Plan is running on a paid service tier (B1).

public static async Task ProcessQueueMessage([QueueTrigger("myTrigger")] CloudQueueMessage message, TextWriter log)
        {
                System.Console.Out.WriteLine($"Start Processing Content");
                await DoSomeWork();
                System.Console.Out.WriteLine($"Processing Content Has Completed");
   }





    • [06/24/2019 00:08:11> 8a8d8d:信息]触发器详细信息:MessageId:
      086184dd-f9be-4e1d-b1e7-49707bd1a4e7,DequeueCount:1,插入时间:
      6/24 / 2019 12:07:48 AM +00:00
      [06/24/2019 00:08:11> 8a8d8d:INFO]开始处理内容[06/24/2019 00:08:15> 8a8d8d :INFO]处理内容已完成
      [06/24/2019 00:08:15> 8a8d8d:INFO]信息:
      Function.ProcessQueueMessage [0] [06/24/2019 00 :08:15> 8a8d8d:INFO]

      执行了' StorageQueueProcessor.ProcessQueueMessage'(成功,
      Id = f3fcd403-515a-4746-803e-fba14d2b0455)[** 06/24 / 2019 00:12:17>
      8a8d8d:ERR] **由于没有
      输出也没有121秒的CPU活动,命令'cmd / c run.cmd'被中止。如果需要,可以增加
      SCM_COMMAND_IDLE_TIMEOUT应用设置(如果此
      是WebJob,则可以增加WEBJOBS_IDLE_TIMEOUT)。
      cmd / c run.cmd [06/24/2019 00:12 :17>
      8a8d8d:SYS INFO]状态更改为失败[06/24/2019 00:12:17>
      8a8d8d:SYS ERR] System.AggregateException:发生一个或多个错误
      。 ---> Kudu.Core.Infrastructure.CommandLineException:由于
      121秒没有输出或CPU活动,命令
      ’cmd / c run.cmd被中止。如果需要,可以增加SCM_COMMAND_IDLE_TIMEOUT应用程序设置
      (如果是WebJob,则增加WEBJOBS_IDLE_TIMEOUT)。 cmd / c
      run.cmd在
      上Kudu.Core.Infrastructure.IdleManager.WaitForExit(IProcess process)在
      中C:\Kudu
      文件\私有\src\master\Kudu.Core\Infrastructure\IdleManager.cs:line
      96 at
      Kudu.Core.Infrastructure.ProcessExtensions.d__13.MoveNext()in
      C :\Kudu
      文件\Private\src\master\Kudu.Core\Infrastructure\ProcessExtensions.cs:line
      254
      ---从堆栈结束跟踪引发异常的先前位置---在
      处$ System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()在
      处System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务
      任务)在
      Kudu.Core.Infrastructure.Executable.d__31.MoveNext()in
      C:\Kudu
      文件\Private\src\master\Kudu.Core\Infrastructure\Executable .cs:line
      255 ---内部异常堆栈跟踪的结尾---在
      处System.Threading.Tasks.Task.ThrowIfExceptional(Boolean
      includeTaskCance ledExceptions)在
      处System.Threading.Tasks.Task 1.GetResultCore(Boolean
      waitCompletionNotification)在
      Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer跟踪器,
      Func
      2 onWriteOutput,Func 2 onWriteError,编码编码,字符串
      参数,Object [] args)在C:\Kudu
      文件中\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line
      216 at
      Kudu.Core.Infrastructure.Executable.ExecuteReturnExitCode(ITracer
      跟踪器,动作
      1 onWriteOutput,动作`1 onWriteError,字符串
      参数,Object [] args)在C:\Kudu
      文件\私有\src\master\ \Kudu.Core\Infrastructure\Executable.cs:line
      165 at Kudu.Core.Jobs.BaseJobRunner.RunJobInstance(JobBase job,
      IJobLogger logger,String runId,String trigger,ITracer tracer,Int32 C:$ Kudu
      文件\Private\src\master\Kudu.Core\Jobs\BaseJobRunner.cs:line 272
      --->
      port) (内部异常#0)退出代码:-1,输出:命令‘cmd / c run.cmd由于在121
      秒内没有输出或CPU活动而中止。您可以根据需要增加SCM_COMMAND_IDLE_TIMEOUT应用程序设置(如果是WebJob,则可以增加
      WEBJOBS_IDLE_TIMEOUT)。错误:命令
      'cmd / c run.cmd'由于无输出或中止
      121秒的CPU活动。您可以根据需要增加SCM_COMMAND_IDLE_TIMEOUT应用设置
      (如果是WebJob,则设置为WEBJOBS_IDLE_TIMEOUT)。
      Kudu.Core.Infrastructure.CommandLineException:命令'cmd / c
      run.cmd 已中止,原因是在121
      秒内没有输出或CPU活动。如果需要,您可以增加SCM_COMMAND_IDLE_TIMEOUT应用程序设置(如果是WebJob,则可以增加
      WEBJOBS_IDLE_TIMEOUT)。 cmd / c
      run.cmd在
      上Kudu.Core.Infrastructure.IdleManager.WaitForExit(IProcess process)在
      中C:\Kudu
      文件\私有\src\master\Kudu.Core\Infrastructure\IdleManager.cs:line
      96 at
      Kudu.Core.Infrastructure.ProcessExtensions.d__13.MoveNext()in
      C :\Kudu
      文件\Private\src\master\Kudu.Core\Infrastructure\ProcessExtensions.cs:line
      254
      ---从堆栈结束跟踪引发异常的先前位置---在
      处$ System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()在
      处System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(任务
      任务)在
      Kudu.Core.Infrastructure.Executable.d__31.MoveNext()in
      C:\Kudu
      文件\Private\src\master\Kudu.Core\Infrastructure\Executable .cs:line
      255< ---

      [06/24/2019 00:08:11 > 8a8d8d: INFO] Trigger Details: MessageId: 086184dd-f9be-4e1d-b1e7-49707bd1a4e7, DequeueCount: 1, InsertionTime: 6/24/2019 12:07:48 AM +00:00 [06/24/2019 00:08:11 > 8a8d8d: INFO] Start Processing Content [06/24/2019 00:08:15 > 8a8d8d: INFO] Processing Content Has Completed [06/24/2019 00:08:15 > 8a8d8d: INFO] info: Function.ProcessQueueMessage[0] [06/24/2019 00:08:15 > 8a8d8d: INFO]
      Executed 'StorageQueueProcessor.ProcessQueueMessage' (Succeeded, Id=f3fcd403-515a-4746-803e-fba14d2b0455) [**06/24/2019 00:12:17 > 8a8d8d: ERR ] **Command 'cmd /c ""run.cmd""' was aborted due to no output nor CPU activity for 121 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed. cmd /c ""run.cmd"" [06/24/2019 00:12:17 > 8a8d8d: SYS INFO] Status changed to Failed [06/24/2019 00:12:17 > 8a8d8d: SYS ERR ] System.AggregateException: One or more errors occurred. ---> Kudu.Core.Infrastructure.CommandLineException: Command 'cmd /c ""run.cmd""' was aborted due to no output nor CPU activity for 121 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed. cmd /c ""run.cmd"" at Kudu.Core.Infrastructure.IdleManager.WaitForExit(IProcess process) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\IdleManager.cs:line 96 at Kudu.Core.Infrastructure.ProcessExtensions.d__13.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\ProcessExtensions.cs:line 254 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Kudu.Core.Infrastructure.Executable.d__31.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 255 --- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func2 onWriteOutput, Func2 onWriteError, Encoding encoding, String arguments, Object[] args) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 216 at Kudu.Core.Infrastructure.Executable.ExecuteReturnExitCode(ITracer tracer, Action1 onWriteOutput, Action`1 onWriteError, String arguments, Object[] args) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 165 at Kudu.Core.Jobs.BaseJobRunner.RunJobInstance(JobBase job, IJobLogger logger, String runId, String trigger, ITracer tracer, Int32 port) in C:\Kudu Files\Private\src\master\Kudu.Core\Jobs\BaseJobRunner.cs:line 272 ---> (Inner Exception #0) ExitCode: -1, Output: Command 'cmd /c ""run.cmd""' was aborted due to no output nor CPU activity for 121 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed., Error: Command 'cmd /c ""run.cmd""' was aborted due to no output nor CPU activity for 121 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed., Kudu.Core.Infrastructure.CommandLineException: Command 'cmd /c ""run.cmd""' was aborted due to no output nor CPU activity for 121 seconds. You can increase the SCM_COMMAND_IDLE_TIMEOUT app setting (or WEBJOBS_IDLE_TIMEOUT if this is a WebJob) if needed. cmd /c ""run.cmd"" at Kudu.Core.Infrastructure.IdleManager.WaitForExit(IProcess process) in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\IdleManager.cs:line 96 at Kudu.Core.Infrastructure.ProcessExtensions.d__13.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\ProcessExtensions.cs:line 254 --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at Kudu.Core.Infrastructure.Executable.d__31.MoveNext() in C:\Kudu Files\Private\src\master\Kudu.Core\Infrastructure\Executable.cs:line 255<---


    • 推荐答案

      解决方案是确保作业以ac身份运行连续的工作而不是触发的工作。

      The solution is to ensure the job is running as a continuous job and not a triggered job.

      这篇关于触发Web作业完全执行,然后中止并超时121秒后的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆