コード例 #1
0
        // Token: 0x06000F33 RID: 3891 RVA: 0x00040734 File Offset: 0x0003E934
        public Exception GetSafetyNetInfosCached(out SafetyNetInfoHashTable safetyNetInfos)
        {
            SafetyNetInfoCache.InnerTable innerTable = this.m_currentTable;
            DateTime  utcNow = DateTime.UtcNow;
            Exception ex     = null;

            safetyNetInfos = null;
            if (this.IsReadThroughNeeded(innerTable))
            {
                lock (this)
                {
                    innerTable = this.m_currentTable;
                    if (this.IsReadThroughNeeded(innerTable))
                    {
                        try
                        {
                            innerTable                    = this.ReadNewTable();
                            this.m_currentTable           = innerTable;
                            this.m_lastTableLoadException = null;
                        }
                        catch (DumpsterRedeliveryException ex2)
                        {
                            ex = ex2;
                        }
                        catch (IOException ex3)
                        {
                            ex = ex3;
                        }
                        catch (ClusterException ex4)
                        {
                            ex = ex4;
                        }
                        if (ex != null)
                        {
                            this.m_lastTableLoadException = ex;
                            SafetyNetInfoCache.Tracer.TraceError <string, Exception>((long)this.GetHashCode(), "GetSafetyNetInfosCached() for '{0}' failed to load the new table: {1}", this.m_dbGuidStr, this.m_lastTableLoadException);
                        }
                    }
                }
            }
            if (innerTable != null)
            {
                safetyNetInfos = innerTable.Table;
            }
            return(ex);
        }
コード例 #2
0
 private static void DoRedeliveryIfRequiredLocked(ReplayConfiguration config, SafetyNetInfoCache snCache, SafetyNetInfoHashTable safetyNetInfos)
 {
     foreach (KeyValuePair <SafetyNetRequestKey, SafetyNetInfo> request in safetyNetInfos)
     {
         SafetyNetRedelivery.ProcessSingleRequest(config, snCache, request);
     }
 }
コード例 #3
0
        public static void DoRedeliveryIfRequired(object replayConfig)
        {
            ReplayConfiguration replayConfiguration = replayConfig as ReplayConfiguration;

            SafetyNetRedelivery.Tracer.TraceDebug <string, string>(0L, "DumpsterRedeliveryManager: DoRedeliveryIfRequired for {0}({1}).", replayConfiguration.Name, replayConfiguration.Identity);
            if (replayConfiguration == null)
            {
                SafetyNetRedelivery.Tracer.TraceError(0L, "DoRedeliveryIfRequired: Invalid ReplayConfiguration object passed in.");
                return;
            }
            Exception ex   = null;
            bool      flag = false;

            try
            {
                SafetyNetInfoCache     safetyNetTable            = replayConfiguration.ReplayState.GetSafetyNetTable();
                SafetyNetInfoHashTable safetyNetInfosReadThrough = safetyNetTable.GetSafetyNetInfosReadThrough();
                if (!safetyNetInfosReadThrough.RedeliveryRequired)
                {
                    SafetyNetRedelivery.Tracer.TraceDebug <string, string>((long)replayConfiguration.GetHashCode(), "DoRedeliveryIfRequired: Skipping Redelivery for {0}({1}) because RedeliveryRequired is 'false'.", replayConfiguration.Name, replayConfiguration.Identity);
                }
                else
                {
                    flag = SafetyNetRedelivery.TryEnterLock(replayConfiguration);
                    if (!flag)
                    {
                        SafetyNetRedelivery.Tracer.TraceDebug <string, string>((long)replayConfiguration.GetHashCode(), "DoRedeliveryIfRequired: Another thread is doing Redelivery on {0}({1})", replayConfiguration.Name, replayConfiguration.Identity);
                    }
                    else
                    {
                        SafetyNetRedelivery.Tracer.TraceDebug <string, string>((long)replayConfiguration.GetHashCode(), "DoRedeliveryIfRequired: Processing dumpster re-delivery for instance {0}({1})", replayConfiguration.Name, replayConfiguration.Identity);
                        SafetyNetRedelivery.DoRedeliveryIfRequiredLocked(replayConfiguration, safetyNetTable, safetyNetInfosReadThrough);
                    }
                }
            }
            catch (DumpsterRedeliveryException ex2)
            {
                ex = ex2;
            }
            catch (MonitoringADConfigException ex3)
            {
                ex = ex3;
            }
            catch (ClusterException ex4)
            {
                ex = ex4;
            }
            catch (TransientException ex5)
            {
                ex = ex5;
            }
            catch (IOException ex6)
            {
                ex = ex6;
            }
            finally
            {
                if (ex != null)
                {
                    SafetyNetRedelivery.Tracer.TraceError <string, string, Exception>((long)replayConfiguration.GetHashCode(), "DoRedeliveryIfRequired() for {0}({1}) failed with Exception: {2}", replayConfiguration.Name, replayConfiguration.Identity, ex);
                    ReplayCrimsonEvents.DumpsterRedeliveryForDatabaseFailed.LogPeriodic <string, Guid, bool, string, Exception>(replayConfiguration.Identity, DiagCore.DefaultEventSuppressionInterval, replayConfiguration.DatabaseName, replayConfiguration.IdentityGuid, false, ex.Message, ex);
                    ReplayEventLogConstants.Tuple_DumpsterRedeliveryFailed.LogEvent(replayConfiguration.Identity, new object[]
                    {
                        ex.Message,
                        replayConfiguration.Name
                    });
                }
                if (flag)
                {
                    SafetyNetRedelivery.ExitLock(replayConfiguration);
                }
            }
        }