几分钟后 OnDemand WebJob 失败
OnDemand WebJob fails after a few minutes
我刚刚创建了简单的 Web 作业,它只是向控制台写入一些内容。这项工作应该按需 运行,所以当我将它发布到 Azure 时,我将其按需设置为 运行。
当我 运行 它时,它工作正常,但几分钟后它失败并显示以下消息。
[12/07/2015 18:07:20 > f78915: ERR ] Command 'cmd /c TestJob.exe' 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 TestJob.exe [12/07/2015 18:07:20 > f78915: SYS INFO] Status changed to Failed
以下是该错误之后的内容:
[12/07/2015 18:07:20 > f78915: SYS ERR ] System.AggregateException: One or more errors occurred. ---> Kudu.Core.Infrastructure.CommandLineException: Command 'cmd /c TestJob.exe' 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 TestJob.exe at Kudu.Core.Infrastructure.IdleManager.WaitForExit(IProcess process)
at Kudu.Core.Infrastructure.ProcessExtensions.d__a.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 Kudu.Core.Infrastructure.Executable.d__1d.MoveNext()
--- End of inner exception stack trace --- at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) at System.Threading.Tasks.Task1.GetResultCore(Boolean waitCompletionNotification) at System.Threading.Tasks.Task
1.get_Result() at Kudu.Core.Infrastructure.Executable.ExecuteInternal(ITracer tracer, Func2 onWriteOutput, Func
2 onWriteError, Encoding encoding, String arguments, Object[] args) at Kudu.Core.Infrastructure.Executable.ExecuteReturnExitCode(ITracer tracer, Action1 onWriteOutput, Action
1 onWriteError, String arguments, Object[] args) at Kudu.Core.Jobs.BaseJobRunner.RunJobInstance(JobBase job, IJobLogger logger, String runId, String trigger, Int32 port) ---> (Inner Exception #0) ExitCode: -1, Output: Command 'cmd /c TestJob.exe' 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 TestJob.exe' 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 TestJob.exe' 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 TestJob.exe at Kudu.Core.Infrastructure.IdleManager.WaitForExit(IProcess process)
at Kudu.Core.Infrastructure.ProcessExtensions.d__a.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 Kudu.Core.Infrastructure.Executable.d__1d.MoveNext()<---
这是此 Web 作业的完整代码。
static void Main()
{
var host = new JobHost();
Console.Out.WriteLine("Testing the test job...");
host.RunAndBlock();
}
我知道它失败是因为没有 activity 但它应该是 运行 按需提供的工作。我哪里出错了?
这是一个按需运行的作业,与错误无关。这只是一项工作,当您告诉它时它就会开始。
在一段时间内(根据您得到的 121 秒)不执行任何操作的作业将中止。