【发布时间】:2018-10-25 19:11:46
【问题描述】:
我有一个状态完整的服务,它正在扫描一个可靠的集合并对其执行一些操作。 RunAsync 中的代码如下:
while (!cancellationToken.IsCancellationRequested)
{
try
{
var cacheItemsWithExpiration = await this.cacheStore.GetAllCacheItemsWithExpiration(); // Call to reliable collection
// some processing on cacheItemsWithExpiration
}
catch (Exception ex)
{
this.telemetryHelper.TrackException(ex); // Telemetry logging
}
}
现在在滚动升级期间,GetAllCacheItemsWithExpiration 方法会引发错误“Primary State Manager 当前不可读”。
现在根据编写的代码,在出现异常后,while 循环应该退出,因为我认为升级将发送取消。但不知何故,它卡在了那个循环中并继续记录异常。
我在 Service Fabric 资源管理器中看到以下消息:
【问题讨论】:
-
只是添加这种情况会在发布时间歇性发生,即不是每次发布。