【问题标题】:Azure webjob deploy causes stop/start/stop again/start againAzure webjob 部署导致停止/启动/再次停止/再次启动
【发布时间】:2015-03-20 09:05:29
【问题描述】:

我看到一个奇怪的模式,当我部署一个 webjob 并启动它时,它会启动,然后立即关闭,然后重新启动。

这是一个连续的网络作业。我从天蓝色停止它,并部署它的新版本,然后再次启动它,我看到了这种模式:

[03/20/2015 08:55:29 > fa2acc: SYS INFO] Status changed to Starting
[03/20/2015 08:55:34 > fa2acc: SYS INFO] Status changed to Stopping
[03/20/2015 08:55:35 > fa2acc: SYS INFO] Run script 'AdHocWebJob.exe' with script host - 'WindowsScriptHost'
[03/20/2015 08:55:35 > fa2acc: SYS INFO] Status changed to Running
[03/20/2015 08:55:36 > fa2acc: INFO] 08:55:35 [1] INFO  Starting the job...
[03/20/2015 08:55:37 > fa2acc: INFO] Found the following functions:
[03/20/2015 08:55:37 > fa2acc: INFO] AdHocWebJob.TestQueueHandler.ProcessSomething
[03/20/2015 08:55:37 > fa2acc: INFO] Job host started
[03/20/2015 08:55:38 > fa2acc: INFO] Executing: 'TestQueueHandler.ProcessSomething' because New queue message detected on 'testrequest'.
[03/20/2015 08:55:38 > fa2acc: INFO] 08:55:38 [6] INFO  Processing item number 6, cancel token:False
[03/20/2015 08:55:39 > fa2acc: INFO] 08:55:39 [6] INFO  1 sec wait cancel token:False
[03/20/2015 08:55:39 > fa2acc: ERR ] Thread was being aborted.
[03/20/2015 08:55:39 > fa2acc: SYS INFO] WebJob process was aborted
[03/20/2015 08:55:39 > fa2acc: SYS INFO] Status changed to Stopped
[03/20/2015 08:55:42 > fa2acc: SYS INFO] Status changed to Starting

事实上,我可以通过停止和启动 webjob 来重新创建它。

这很痛苦 - 因为它导致第一个 QueueTrigger 被丢弃。

对为什么会发生这种情况以及我能做些什么(如果有的话)有什么想法吗?

【问题讨论】:

    标签: azure azure-webjobs


    【解决方案1】:

    您如何部署 WebJob?如果您从 Visual Studio 或使用门户中的 zip 文件执行此操作,我认为您不需要停止或重新启动,因为部署会为您执行此操作。

    【讨论】:

    • 我是从 VS 做的(发布为 azure web 作业)。但是,当我只是停止并开始工作而没有部署它时,我也看到了这一点
    • 日志中的“ERR ] 线程被中止”怎么样?您的代码中是否引发了异常?
    猜你喜欢
    • 2019-01-18
    • 1970-01-01
    • 1970-01-01
    • 2011-05-11
    • 1970-01-01
    • 2016-09-29
    • 2023-03-22
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多