예제 #1
0
 private void OnContainerFaulted(object sender, ContainerHealthMonitorEventArgs e)
 {
     if (this.containerProcessDictByPort.TryRemove(e.Port, out var removedContainer))
     {
         Debug.WriteLine($"{typeof(ProcessManager).Name}: removed container[{removedContainer.Port}] ({DateTime.Now})");
     }
 }
        public static void OnContainerHealthFaulted(object sender, ContainerHealthMonitorEventArgs args)
        {
            var oldRoleInstance = args.RoleInstance;

            RoleEnvironment.SafeRemove(oldRoleInstance);

            Console.WriteLine($"{oldRoleInstance.Port}: Container faulted. Recovering...");

            RecoverFromFailureAsync(oldRoleInstance, ProcessManager.SingletonInstance).GetAwaiter().GetResult();
        }