gpt4 book ai didi

c# - OnDemand WebJob 在几分钟后失败

转载 作者:行者123 更新时间:2023-12-04 01:58:16 30 4
gpt4 key购买 nike

我刚刚创建了简单的网络作业,只向控制台写入一些内容。该作业应该按需运行,因此当我将其发布到 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, Func2 onWriteError, Encoding encoding, String arguments, Object[] args) at Kudu.Core.Infrastructure.Executable.ExecuteReturnExitCode(ITracer tracer, Action1 onWriteOutput, Action1 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()<---

这是此网络作业的完整代码。

static void Main()
{
var host = new JobHost();
Console.Out.WriteLine("Testing the test job...");
host.RunAndBlock();
}

我知道它失败是因为没有事件,但它应该是按需运行的作业。我哪里出错了?

最佳答案

事实上,这是一项按需运行的作业,与该错误无关。这只是一项当你告诉它时就开始的工作。

在一段时间内(根据您得到的数据为 121 秒)不执行任何操作的作业将中止。

关于c# - OnDemand WebJob 在几分钟后失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34143042/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com