任务和天蓝色工作者角色中未处理的异常

时间:2015-04-01 03:16:00

标签: c# azure

我有一个Azure辅助角色,我在其中运行多个任务。

任何任务中的任何未处理的异常都会导致角色回收?

例如,在事件查看器中,我看到了以下堆栈跟踪,我相信它会导致回收。

  

---抛出异常的上一个位置的堆栈跟踪结束---      在System.Runtime.CompilerServices.AsyncMethodBuilderCore.b__1(对象状态)      at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext,ContextCallback callback,Object state,Boolean preserveSyncCtx)      at System.Threading.ExecutionContext.Run(ExecutionContext executionContext,ContextCallback callback,Object state,Boolean preserveSyncCtx)      在System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()      在System.Threading.ThreadPoolWorkQueue.Dispatch()

1 个答案:

答案 0 :(得分:1)

任何导致Run()方法在WorkerRole上返回的东西,都会导致该角色被回收。这显然包括未处理的例外。

相关问题