protected override void InternalRun()
        {
            if (!ReplicationCheckGlobals.ServerLocatorServiceCheckHasRun)
            {
                ReplicationCheckGlobals.ServerLocatorServiceCheckHasRun = true;
            }
            else
            {
                ExTraceGlobals.HealthChecksTracer.TraceDebug((long)this.GetHashCode(), "ServerLocatorServiceCheck skipping because it has already been run once.");
                base.Skip();
            }
            if (!IgnoreTransientErrors.HasPassed(base.GetDefaultErrorKey(typeof(ReplayServiceCheck))))
            {
                ExTraceGlobals.HealthChecksTracer.TraceDebug <string>((long)this.GetHashCode(), "ReplayServiceCheck didn't pass! Skipping {0}.", base.Title);
                base.Skip();
            }
            if ((ReplicationCheckGlobals.ServerConfiguration & ServerConfig.Stopped) == ServerConfig.Stopped)
            {
                ExTraceGlobals.HealthChecksTracer.TraceDebug <string>((long)this.GetHashCode(), "Stopped server! Skipping {0}.", base.Title);
                base.Skip();
            }
            string text = null;
            bool   flag = false;
            ServerLocatorServiceClient serverLocatorServiceClient = null;
            TimeSpan timeSpan = TimeSpan.FromSeconds(5.0);

            try
            {
                serverLocatorServiceClient = ServerLocatorServiceClient.Create(base.ServerName, timeSpan, timeSpan, timeSpan, timeSpan);
                serverLocatorServiceClient.GetVersion();
                flag = true;
            }
            catch (ServerLocatorClientException ex)
            {
                text = ex.Message;
            }
            catch (ServerLocatorClientTransientException ex2)
            {
                text = ex2.Message;
            }
            finally
            {
                if (serverLocatorServiceClient != null)
                {
                    serverLocatorServiceClient.Dispose();
                    serverLocatorServiceClient = null;
                }
            }
            ExTraceGlobals.HealthChecksTracer.TraceDebug <string, bool, string>((long)this.GetHashCode(), "ServerLocatorServiceCheck: TestHealth() for server '{0}' returned: healthy={1}, errMsg='{2}'", base.ServerName, flag, text);
            if (!flag)
            {
                base.Fail(Strings.ServerLocatorServiceRequestFailed(base.ServerName, text));
            }
        }
示例#2
0
 internal void Clear()
 {
     while (Interlocked.CompareExchange(ref WcfProxyObjectsPool.s_backgroundThreadSyncPoint, -1, 0) != 0)
     {
         Thread.Yield();
     }
     lock (this.lockObject)
     {
         foreach (WcfProxyObjectsPerServerStack wcfProxyObjectsPerServerStack in this.m_dictionary.Values)
         {
             while (wcfProxyObjectsPerServerStack.Count > 0)
             {
                 ServerLocatorServiceClient serverLocatorServiceClient = wcfProxyObjectsPerServerStack.Pop();
                 serverLocatorServiceClient.Dispose(true);
             }
         }
         this.m_dictionary.Clear();
     }
     WcfProxyObjectsPool.s_backgroundThreadSyncPoint = 0;
 }