我有一个 Azure WorkerRole 无缘无故地停止(没有抛出异常)。它每次都停在同一个地方,但代码只是执行一个需要大约 20 秒才能运行的进程。任何人都可以假设为什么会这样吗?我不知道的 OnStart() 方法是否存在超时?
以下是我的工人角色中发生的事情的细分:
OnStart() -> 诊断配置
运行()->
- 设置定时器 (60) 以触发应用程序的内容
- 启动一个新线程以加载一些默认设置(大约需要 30 秒)
代码永远不会触及#1 的内容。
对于上面的#1,我已经尝试过使用和不使用计时器(没有区别)。对于上面的#2,我已经尝试过启动新线程和不启动新线程(没有区别)。
这是我的工作人员角色的调试输出:
WaWorkerHost.exe Information: 0 : deployment(108).ApiAzure.Workers.0 - Workers.OnStart()
Microsoft.WindowsAzure.ServiceRuntime Information: 202 : Role entrypoint . COMPLETED OnStart()
The thread 'Role Initialization Thread' (0x29fc) has exited with code 0 (0x0).
Microsoft.WindowsAzure.ServiceRuntime Information: 203 : Role entrypoint . CALLING Run()
'WaWorkerHost.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Jason A. Kiesel\Projects\FS_CITYSOURCED\WorkersAzure\bin\Stage\WorkersAzure.csx\roles\Workers\approot\FreedomSpeaks.Logging.dll', Symbols loaded.
Microsoft.WindowsAzure.ServiceRuntime Warning: 204 : Role entrypoint . COMPLETED Run() ==> ROLE RECYCLING INITIATED
Microsoft.WindowsAzure.ServiceRuntime Information: 503 : Role instance recycling is starting
The thread 'Role Start Thread' (0x1fa0) has exited with code 0 (0x0).
The thread '<No Name>' (0x1624) has exited with code 0 (0x0).
'WaWorkerHost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.Data\v4.0_4.0.0.0__b77a5c561934e089\System.Data.dll'
'WaWorkerHost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.Transactions\v4.0_4.0.0.0__b77a5c561934e089\System.Transactions.dll'
'WaWorkerHost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_64\System.EnterpriseServices\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.EnterpriseServices.dll'
'WaWorkerHost.exe' (Managed (v4.0.30319)): Loaded 'C:\Windows\Microsoft.Net\assembly\GAC_MSIL\System.Numerics\v4.0_4.0.0.0__b77a5c561934e089\System.Numerics.dll', Skipped loading symbols. Module is optimized and the debugger option 'Just My Code' is enabled.
Microsoft.WindowsAzure.ServiceRuntime Information: 205 : Role entrypoint . CALLING OnStop()
WaWorkerHost.exe Information: 0 : deployment(108).ApiAzure.Workers.0 - Workers.OnStop()
Microsoft.WindowsAzure.ServiceRuntime Information: 206 : Role entrypoint . COMPLETED OnStop()
The thread 'Role Stop Thread' (0x2dac) has exited with code 0 (0x0).
The program '[12228] WaWorkerHost.exe: Managed (v4.0.30319)' has exited with code -66053 (0xfffefdfb).