public static HungNodesInfo GetNodesHungInClusDbUpdate() { HungNodesInfo result = null; TimeSpan timeout = TimeSpan.FromSeconds((double)RegistryParameters.OpenClusterTimeoutInSec); using (AmCluster amCluster = AmCluster.OpenByName(AmServerName.LocalComputerName, timeout, string.Empty)) { int num = 0; AmServerName currentGumLockOwnerInfo = amCluster.GetCurrentGumLockOwnerInfo(out num); if (!AmServerName.IsNullOrEmpty(currentGumLockOwnerInfo)) { Thread.Sleep(RegistryParameters.ClusdbHungNodesConfirmDurationInMSec); string context = string.Format("GUM={0}", num); using (AmCluster amCluster2 = AmCluster.OpenByName(currentGumLockOwnerInfo, timeout, context)) { using (IAmClusterNode amClusterNode = amCluster2.OpenNode(currentGumLockOwnerInfo)) { int num2 = 0; long hungNodesMask = amClusterNode.GetHungNodesMask(out num2); if (num != num2) { throw new HungDetectionGumIdChangedException(num, num2, currentGumLockOwnerInfo.ToString(), hungNodesMask); } result = new HungNodesInfo(num, currentGumLockOwnerInfo, hungNodesMask); } } } } return(result); }
private HungNodesInfo(int currentGumId, AmServerName lockOwnerName, long hungNodesMask) { this.CurrentGumId = currentGumId; this.CurrentLockOwnerName = lockOwnerName; this.HungNodesAsBitmask = hungNodesMask; this.NodeMap = HungNodesInfo.GenerateHungNodeMap(hungNodesMask); }