Esempio n. 1
0
        private static TimeSpan GetLivenessStabilizationTime(GlobalConfiguration global, bool didKill = false)
        {
            TimeSpan stabilizationTime = TimeSpan.Zero;

            if (didKill)
            {
                // in case of hard kill (kill and not Stop), we should give silos time to detect failures first.
                stabilizationTime = UnitTestUtils.Multiply(global.ProbeTimeout, global.NumMissedProbesLimit);
            }
            if (global.UseLivenessGossip)
            {
                stabilizationTime += TimeSpan.FromSeconds(5);
            }
            else
            {
                stabilizationTime += UnitTestUtils.Multiply(global.TableRefreshTimeout, 2);
            }
            return(stabilizationTime);
        }
Esempio n. 2
0
        /// <summary>
        /// Wait for the silo liveness sub-system to detect and act on any recent cluster membership changes.
        /// </summary>
        /// <param name="didKill">Whether recent membership changes we done by graceful Stop.</param>
        public void WaitForLivenessToStabilize(bool didKill = false)
        {
            TimeSpan stabilizationTime = TimeSpan.Zero;

            if (didKill)
            {
                // in case of hard kill (kill and not Stop), we should give silos time to detect failures first.
                stabilizationTime = UnitTestUtils.Multiply(globalConfig.ProbeTimeout, globalConfig.NumMissedProbesLimit);
            }
            if (globalConfig.UseLivenessGossip)
            {
                stabilizationTime += TimeSpan.FromSeconds(5);
            }
            else
            {
                stabilizationTime += UnitTestUtils.Multiply(globalConfig.TableRefreshTimeout, 2);
            }
            WriteLog("\n\nWaitForLivenessToStabilize is about to sleep for {0}", stabilizationTime);
            Thread.Sleep(stabilizationTime);
            WriteLog("WaitForLivenessToStabilize is done sleeping");
        }